aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/edit/views.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2014-06-02 20:59:28 +0300
committerBerker Peksag <berker.peksag@gmail.com>2014-06-02 20:59:28 +0300
commite49b7e02b2150413d2e78db709277fae0887be46 (patch)
tree6c39946f2b4aca080c75274f97ec263f793ae012 /mediagoblin/edit/views.py
parenta80c74bbcc6ac0208cfef725a441810a29876cff (diff)
downloadmediagoblin-e49b7e02b2150413d2e78db709277fae0887be46.tar.lz
mediagoblin-e49b7e02b2150413d2e78db709277fae0887be46.tar.xz
mediagoblin-e49b7e02b2150413d2e78db709277fae0887be46.zip
Use six.text_type instead of unicode().
I will be switch to use ``from __future__ import unicode_literals`` later.
Diffstat (limited to 'mediagoblin/edit/views.py')
-rw-r--r--mediagoblin/edit/views.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py
index 80590875..52f808b6 100644
--- a/mediagoblin/edit/views.py
+++ b/mediagoblin/edit/views.py
@@ -14,6 +14,8 @@
# 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 six
+
from datetime import datetime
from itsdangerous import BadSignature
@@ -77,7 +79,7 @@ def edit_media(request, media):
media.tags = convert_to_tag_list_of_dicts(
form.tags.data)
- media.license = unicode(form.license.data) or None
+ media.license = six.text_type(form.license.data) or None
media.slug = slug
media.save()
@@ -135,7 +137,7 @@ def edit_attachments(request, media):
attachment_public_filepath \
= mg_globals.public_store.get_unique_filepath(
- ['media_entries', unicode(media.id), 'attachment',
+ ['media_entries', six.text_type(media.id), 'attachment',
public_filename])
attachment_public_file = mg_globals.public_store.get_file(
@@ -200,8 +202,8 @@ def edit_profile(request, url_user=None):
bio=user.bio)
if request.method == 'POST' and form.validate():
- user.url = unicode(form.url.data)
- user.bio = unicode(form.bio.data)
+ user.url = six.text_type(form.url.data)
+ user.bio = six.text_type(form.bio.data)
user.save()
@@ -316,9 +318,9 @@ def edit_collection(request, collection):
form.slug.errors.append(
_(u'A collection with that slug already exists for this user.'))
else:
- collection.title = unicode(form.title.data)
- collection.description = unicode(form.description.data)
- collection.slug = unicode(form.slug.data)
+ collection.title = six.text_type(form.title.data)
+ collection.description = six.text_type(form.description.data)
+ collection.slug = six.text_type(form.slug.data)
collection.save()