From e119aed22900b682c7dd2cce979f694282f5dbe5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ste=CC=81phane=20Pe=CC=81chard?= Date: Tue, 23 Sep 2014 16:11:39 +0200 Subject: [PATCH] Add creator to filter collections --- mediagoblin/submit/lib.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mediagoblin/submit/lib.py b/mediagoblin/submit/lib.py index b23bdf69..d54591d6 100644 --- a/mediagoblin/submit/lib.py +++ b/mediagoblin/submit/lib.py @@ -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 # -- 2.25.1