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.
This commit is contained in:
parent
6bfc7f77bc
commit
27b85ce560
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user