raises tag length error in form context instead of in message queue
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):
|
||||
@@ -25,7 +26,9 @@ class EditForm(wtforms.Form):
|
||||
slug = wtforms.TextField(
|
||||
'Slug')
|
||||
description = wtforms.TextAreaField('Description of this work')
|
||||
tags = wtforms.TextField('Tags')
|
||||
tags = wtforms.TextField(
|
||||
'Tags',
|
||||
[tag_length_validator])
|
||||
|
||||
class EditProfileForm(wtforms.Form):
|
||||
bio = wtforms.TextAreaField('Bio',
|
||||
|
||||
@@ -55,6 +55,7 @@ def edit_media(request, media):
|
||||
else:
|
||||
media['title'] = request.POST['title']
|
||||
media['description'] = request.POST.get('description')
|
||||
media['tags'] = convert_to_tag_list(request.POST.get('tags'))
|
||||
|
||||
md = markdown.Markdown(
|
||||
safe_mode = 'escape')
|
||||
@@ -63,9 +64,6 @@ def edit_media(request, media):
|
||||
media['description']))
|
||||
|
||||
media['slug'] = request.POST['slug']
|
||||
|
||||
# Process the user's folksonomy "tags"
|
||||
media['tags'] = convert_to_tag_list(request)
|
||||
media.save()
|
||||
|
||||
return redirect(request, "mediagoblin.user_pages.media_home",
|
||||
|
||||
Reference in New Issue
Block a user