when querying event, replace one by first to avoid raising an exception when the event is not found
authorymh <ymh.work@gmail.com>
Thu, 23 Oct 2014 17:51:55 +0200
changeset 57 cb4df234fd79
parent 56 b90c1bd1a46e
child 58 726ee64f18a9
when querying event, replace one by first to avoid raising an exception when the event is not found
annot-server/webapp/views.py
--- a/annot-server/webapp/views.py	Thu Oct 23 10:42:11 2014 +0200
+++ b/annot-server/webapp/views.py	Thu Oct 23 17:51:55 2014 +0200
@@ -32,7 +32,7 @@
 def page_annotationclient_event_code(event_code):
     #TODO: check event code + get event session
     event_query = db_session.query(models.Event).filter(models.Event.code == event_code, models.Event.active == True)
-    event = event_query.one()
+    event = event_query.first()
 
     if not event:
         abort(404)