From 27b85ce5608030036675663ca8a1d9e2806c37f8 Mon Sep 17 00:00:00 2001 From: Patrick Smith Date: Thu, 30 Aug 2018 14:38:23 -0400 Subject: [PATCH] Catch DataError when querying for request A `DataError` can be raised if we try to find a request with an id that is not a valid UUID. --- atst/domain/requests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atst/domain/requests.py b/atst/domain/requests.py index 3169a95e..28c78ae8 100644 --- a/atst/domain/requests.py +++ b/atst/domain/requests.py @@ -63,7 +63,7 @@ class Requests(object): def get(cls, user, request_id): try: request = db.session.query(Request).filter_by(id=request_id).one() - except NoResultFound: + except (NoResultFound, exc.DataError): raise NotFoundError("request") if not Authorization.can_view_request(user, request):