aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Forbes Davis V <caldavis@gmail.com>2011-07-12 20:43:16 -0500
committerCaleb Forbes Davis V <caldavis@gmail.com>2011-07-12 20:43:16 -0500
commit93e3468a2af92a623a659628a20605025cea9ca7 (patch)
treeb0d23392df5b1111eb1c9f80c9fd174334f3e284
parentcdf538bd6163a47b4c4a6326c943b6deaf2c495a (diff)
downloadmediagoblin-93e3468a2af92a623a659628a20605025cea9ca7.tar.lz
mediagoblin-93e3468a2af92a623a659628a20605025cea9ca7.tar.xz
mediagoblin-93e3468a2af92a623a659628a20605025cea9ca7.zip
displays the tags on edit correctly now
-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
-rw-r--r--mediagoblin/edit/forms.py2
-rw-r--r--mediagoblin/edit/views.py2
-rw-r--r--mediagoblin/util.py4
3 files changed, 4 insertions, 4 deletions
diff --git a/mediagoblin/edit/forms.py b/mediagoblin/edit/forms.py
index 5e3aab96..e13cfaa9 100644
--- a/mediagoblin/edit/forms.py
+++ b/mediagoblin/edit/forms.py
@@ -27,7 +27,7 @@ class EditForm(wtforms.Form):
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',
diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py
index f5e7f454..0c4fd735 100644
--- a/mediagoblin/edit/views.py
+++ b/mediagoblin/edit/views.py
@@ -62,7 +62,7 @@ def edit_media(request, media):
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",
diff --git a/mediagoblin/util.py b/mediagoblin/util.py
index 7ee0a2d5..4421bec4 100644
--- a/mediagoblin/util.py
+++ b/mediagoblin/util.py
@@ -370,7 +370,7 @@ def clean_html(html):
return HTML_CLEANER.clean_html(html)
-TAGS_DELIMITER = ' '
+TAGS_DELIMITER = u' '
def convert_to_tag_list(tag_string):
"""
@@ -381,7 +381,7 @@ 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