-before it was running the tags field through the submit filter.
that was kind of dumb
-removes the filter function from the edit form
-adds unicode syntax in the filter function
-uses split correctly when saving the edited tags to mongodb
slug = wtforms.TextField(
'Slug')
description = wtforms.TextAreaField('Description of this work')
- tags = wtforms.TextField('Tags', filters=[convert_to_tag_list])
+ tags = wtforms.TextField('Tags')
class EditProfileForm(wtforms.Form):
bio = wtforms.TextAreaField('Bio',
media['description']))
media['slug'] = request.POST['slug']
- media['tags'] = split(request.POST['tags'])
+ media['tags'] = request.POST['tags'].split(TAGS_DELIMITER)
media.save()
return redirect(request, "mediagoblin.user_pages.media_home",
return HTML_CLEANER.clean_html(html)
-TAGS_DELIMITER = ' '
+TAGS_DELIMITER = u' '
def convert_to_tag_list(tag_string):
"""
"""
if tag_string:
taglist = []
- stripped_tag_string = ' '.join(tag_string.strip().split())
+ stripped_tag_string = u' '.join(tag_string.strip().split())
for tag in stripped_tag_string.split(TAGS_DELIMITER):
if tag.strip(): taglist.append(tag.strip())
return taglist