mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-11 10:28:55 -04:00
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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user