aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/edit/views.py
diff options
context:
space:
mode:
authorRodney Ewing <ewing.rj@gmail.com>2013-07-11 14:17:50 -0700
committerRodney Ewing <ewing.rj@gmail.com>2013-07-11 14:17:50 -0700
commit44082b12d8a418bacd1ca5b19f7ce2595e07c1ee (patch)
tree1c252c5ea85df0ab142b0b4ae1a3d5b1ab6230db /mediagoblin/edit/views.py
parent3aeca53c85981fa46d61b41a7cf648d90637eb62 (diff)
downloadmediagoblin-44082b12d8a418bacd1ca5b19f7ce2595e07c1ee.tar.lz
mediagoblin-44082b12d8a418bacd1ca5b19f7ce2595e07c1ee.tar.xz
mediagoblin-44082b12d8a418bacd1ca5b19f7ce2595e07c1ee.zip
Patch by Strum. Ticket #451 - Convert all mongokit style .find, .find_one, .one calls over to SQLAlchemy queries
Diffstat (limited to 'mediagoblin/edit/views.py')
-rw-r--r--mediagoblin/edit/views.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py
index 7a8d6185..6aa2acd9 100644
--- a/mediagoblin/edit/views.py
+++ b/mediagoblin/edit/views.py
@@ -305,9 +305,9 @@ def edit_collection(request, collection):
form.slug.data, collection.id)
# Make sure there isn't already a Collection with this title
- existing_collection = request.db.Collection.find_one({
- 'creator': request.user.id,
- 'title':form.title.data})
+ existing_collection = request.db.Collection.query.filter_by(
+ creator=request.user.id,
+ title=form.title.data).first()
if existing_collection and existing_collection.id != collection.id:
messages.add_message(