From 08750772eaf140266d1be0aac5024f581664012b Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Mon, 22 Aug 2011 02:57:40 -0700 Subject: + 'confirm' section for confirmation dialogues + implemented delete functionality * fixed several instances of 'must be an instance of unicode, not str' --- mediagoblin/edit/views.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'mediagoblin/edit') diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py index 0b1a98f1..2a835816 100644 --- a/mediagoblin/edit/views.py +++ b/mediagoblin/edit/views.py @@ -14,6 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +import uuid from webob import exc from string import split @@ -53,15 +54,17 @@ def edit_media(request, media): form.slug.errors.append( _(u'An entry with that slug already exists for this user.')) else: - media['title'] = request.POST['title'] - media['description'] = request.POST.get('description') + media['title'] = unicode(request.POST['title']) + media['description'] = unicode(request.POST.get('description')) media['tags'] = convert_to_tag_list_of_dicts( request.POST.get('tags')) media['description_html'] = cleaned_markdown_conversion( media['description']) - media['slug'] = request.POST['slug'] + media['slug'] = unicode(request.POST['slug']) + task_id = unicode(uuid.uuid4()) + media['queued_task_id'] = task_id media.save() return redirect(request, "mediagoblin.user_pages.media_home", @@ -102,8 +105,8 @@ def edit_profile(request): bio = user.get('bio')) if request.method == 'POST' and form.validate(): - user['url'] = request.POST['url'] - user['bio'] = request.POST['bio'] + user['url'] = unicode(request.POST['url']) + user['bio'] = unicode(request.POST['bio']) user['bio_html'] = cleaned_markdown_conversion(user['bio']) -- cgit v1.2.3