Add creator to filter collections
authorStéphane Péchard <stephanepechard@gmail.com>
Tue, 23 Sep 2014 14:11:39 +0000 (16:11 +0200)
committerStéphane Péchard <stephanepechard@gmail.com>
Tue, 23 Sep 2014 14:11:39 +0000 (16:11 +0200)
mediagoblin/submit/lib.py

index b23bdf6999a0bd5c9387d5081e9359952f01a584..d54591d6fb312c7b1e17a5eb5ac98b3e975865bb 100644 (file)
@@ -195,8 +195,9 @@ def submit_media(mg_app, user, submitted_file, filename,
 
     # add to collection
     if collection_slug:
-        collection = Collection.query.filter_by(slug=collection_slug).first()
-        add_media_to_collection(collection, entry)
+        collection = Collection.query.filter_by(slug=collection_slug, creator=user.id).first()
+        if collection:
+            add_media_to_collection(collection, entry)
 
     # Pass off to processing
     #