Merge branch 'remotes/gullydwarf-cfdv/f360_tagging' (early part) into mergetags
Conflicts: mediagoblin/config_spec.ini mediagoblin/edit/views.py mediagoblin/util.py
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
|
||||
import wtforms
|
||||
from mediagoblin.util import tag_length_validator, TOO_LONG_TAG_WARNING
|
||||
|
||||
|
||||
class EditForm(wtforms.Form):
|
||||
@@ -26,6 +27,9 @@ class EditForm(wtforms.Form):
|
||||
'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',
|
||||
|
||||
@@ -16,10 +16,13 @@
|
||||
|
||||
|
||||
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, 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
|
||||
@@ -34,7 +37,8 @@ def edit_media(request, media):
|
||||
form = forms.EditForm(request.POST,
|
||||
title = media['title'],
|
||||
slug = media['slug'],
|
||||
description = media['description'])
|
||||
description = media['description'],
|
||||
tags = media_tags_as_string(media['tags']))
|
||||
|
||||
if request.method == 'POST' and form.validate():
|
||||
# Make sure there isn't already a MediaEntry with such a slug
|
||||
@@ -50,7 +54,9 @@ def edit_media(request, media):
|
||||
else:
|
||||
media['title'] = request.POST['title']
|
||||
media['description'] = request.POST.get('description')
|
||||
|
||||
media['tags'] = convert_to_tag_list_of_dicts(
|
||||
request.POST.get('tags'))
|
||||
|
||||
media['description_html'] = cleaned_markdown_conversion(
|
||||
media['description'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user