Fix add collection view for new schema
authorDaniel Krol <orblivion@gmail.com>
Mon, 9 Nov 2015 08:11:36 +0000 (00:11 -0800)
committerDaniel Krol <orblivion@gmail.com>
Mon, 9 Nov 2015 08:13:53 +0000 (00:13 -0800)
mediagoblin/submit/views.py

index ccdd70bc7f61b3a684dbd4481b1683be1a6eafe2..eae4a1e7989720fd406959e3e9cad4a15449ad81 100644 (file)
@@ -112,12 +112,14 @@ def add_collection(request, media=None):
 
         collection.title = six.text_type(submit_form.title.data)
         collection.description = six.text_type(submit_form.description.data)
-        collection.creator = request.user.id
+        collection.actor = request.user.id
+        collection.type = request.db.Collection.USER_DEFINED_TYPE
         collection.generate_slug()
 
         # Make sure this user isn't duplicating an existing collection
         existing_collection = request.db.Collection.query.filter_by(
-                creator=request.user.id,
+                actor=request.user.id,
+                type=request.db.Collection.USER_DEFINED_TYPE,
                 title=collection.title).first()
 
         if existing_collection: