Piwigo: some sanity checks before adding to collection as per Elrond's suggestions.

This commit is contained in:
Mats Sjöberg 2013-05-21 22:46:57 +03:00
parent 7da90d56d1
commit 94d3192041

View File

@ -179,7 +179,8 @@ def pwg_images_addSimple(request):
collection_id = form.category.data
if collection_id > 0:
collection = Collection.query.get(collection_id)
add_media_to_collection(collection, entry, "")
if collection is not None and collection.creator == request.user.id:
add_media_to_collection(collection, entry, "")
return {'image_id': entry.id, 'url': entry.url_for_self(request.urlgen,
qualified=True)}