email_debug_mode = boolean(default=True)
email_sender_address = string(default="notice@mediagoblin.example.org")
+# Set to false to disable registrations
+allow_registration = boolean(default=True)
+
+ # tag parsing
+ tags_delimiter = string(default=",")
+ tags_case_sensitive = boolean(default=False)
+ tags_max_length = integer(default=50)
+
# By default not set, but you might want something like:
# "%(here)s/user_dev/templates/"
local_templates = string()
'Title',
[wtforms.validators.Length(min=0, max=500)])
slug = wtforms.TextField(
- 'Slug')
+ 'Slug',
+ [wtforms.validators.Required(message="The slug can't be empty")])
description = wtforms.TextAreaField('Description of this work')
+ tags = wtforms.TextField(
+ 'Tags',
+ [tag_length_validator])
class EditProfileForm(wtforms.Form):
bio = wtforms.TextAreaField('Bio',
from webob import exc
+ from string import split
from mediagoblin import messages
+ from mediagoblin import mg_globals
from mediagoblin.util import (
- render_to_response, redirect, cleaned_markdown_conversion)
+ render_to_response, redirect, clean_html, convert_to_tag_list_of_dicts,
- media_tags_as_string)
++ media_tags_as_string, cleaned_markdown_conversion)
from mediagoblin.edit import forms
from mediagoblin.edit.lib import may_edit_media
from mediagoblin.decorators import require_active_login, get_user_media_entry
else:
media['title'] = request.POST['title']
media['description'] = request.POST.get('description')
-
+ media['tags'] = convert_to_tag_list_of_dicts(
+ request.POST.get('tags'))
+
- md = markdown.Markdown(
- safe_mode = 'escape')
- media['description_html'] = clean_html(
- md.convert(
- media['description']))
+ media['description_html'] = cleaned_markdown_conversion(
+ media['description'])
media['slug'] = request.POST['slug']
media.save()