aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/edit/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/edit/views.py')
-rw-r--r--mediagoblin/edit/views.py24
1 files changed, 7 insertions, 17 deletions
diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py
index b0145a04..11bee110 100644
--- a/mediagoblin/edit/views.py
+++ b/mediagoblin/edit/views.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 Free Software Foundation, Inc
+# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -14,6 +14,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import uuid
from webob import exc
from string import split
@@ -45,9 +46,6 @@ def edit_media(request, media):
description=media['description'],
tags=media_tags_as_string(media['tags']))
- if len(media['attachment_files']):
- defaults['attachment_name'] = media['attachment_files'][0]['name']
-
form = forms.EditForm(
request.POST,
**defaults)
@@ -64,23 +62,15 @@ 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'])
- if 'attachment_name' in request.POST:
- media['attachment_files'][0]['name'] = \
- request.POST['attachment_name']
-
- if 'attachment_delete' in request.POST \
- and 'y' == request.POST['attachment_delete']:
- del media['attachment_files'][0]
-
- media['slug'] = request.POST['slug']
+ media['slug'] = unicode(request.POST['slug'])
media.save()
return redirect(request, "mediagoblin.user_pages.media_home",
@@ -171,8 +161,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'])