Replaced first queries with one queries, which throws a NoResultFound.

Able to remove many of the None checks as a result of this.
Fixed the tests were needed.
This commit is contained in:
Rebecca Law
2016-03-11 15:34:20 +00:00
parent ef5969be77
commit 123b0ead3a
14 changed files with 26 additions and 66 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ def dao_fetch_all_services_by_user(user_id):
def dao_fetch_service_by_id_and_user(service_id, user_id):
return Service.query.filter(Service.users.any(id=user_id)).filter_by(id=service_id).first()
return Service.query.filter(Service.users.any(id=user_id)).filter_by(id=service_id).one()
def dao_create_service(service, user):