aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/plugins/piwigo/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/plugins/piwigo/views.py')
-rw-r--r--mediagoblin/plugins/piwigo/views.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/mediagoblin/plugins/piwigo/views.py b/mediagoblin/plugins/piwigo/views.py
index f913a730..30c7ffa2 100644
--- a/mediagoblin/plugins/piwigo/views.py
+++ b/mediagoblin/plugins/piwigo/views.py
@@ -17,6 +17,8 @@
import logging
import re
+import six
+
from werkzeug.exceptions import MethodNotAllowed, BadRequest, NotImplemented
from werkzeug.wrappers import BaseResponse
@@ -80,7 +82,7 @@ def pwg_categories_getList(request):
if request.user:
collections = Collection.query.filter_by(
- get_creator=request.user).order_by(Collection.title)
+ get_actor=request.user).order_by(Collection.title)
for c in collections:
catlist.append({'id': c.id,
@@ -126,21 +128,18 @@ def pwg_images_addSimple(request):
if not check_file_field(request, 'image'):
raise BadRequest()
- upload_limit, max_file_size = get_upload_file_limits(request.user)
-
try:
entry = submit_media(
mg_app=request.app, user=request.user,
submitted_file=request.files['image'],
filename=request.files['image'].filename,
- title=unicode(form.name.data),
- description=unicode(form.comment.data),
- upload_limit=upload_limit, max_file_size=max_file_size)
+ title=six.text_type(form.name.data),
+ description=six.text_type(form.comment.data))
collection_id = form.category.data
if collection_id > 0:
collection = Collection.query.get(collection_id)
- if collection is not None and collection.creator == request.user.id:
+ if collection is not None and collection.actor == request.user.id:
add_media_to_collection(collection, entry, "")
return {