get_object_or_404: Catch OverflowError

This is one of the larger sets of OverflowError that I am encountering.

Related to https://github.com/encode/django-rest-framework/issues/7448
This commit is contained in:
John Vandenberg 2020-08-02 14:14:49 +07:00
parent 559088463b
commit 609d3e9046

View File

@ -17,7 +17,7 @@ def get_object_or_404(queryset, *filter_args, **filter_kwargs):
"""
try:
return _get_object_or_404(queryset, *filter_args, **filter_kwargs)
except (TypeError, ValueError, ValidationError):
except (OverflowError, TypeError, ValueError, ValidationError):
raise Http404