diff --git a/ietf/settings.py b/ietf/settings.py index d533dfccf..f2fd283d0 100644 --- a/ietf/settings.py +++ b/ietf/settings.py @@ -1137,6 +1137,7 @@ CHECKS_LIBRARY_PATCHES_TO_APPLY = [ 'patch/fix-django-password-strength-kwargs.patch', 'patch/add-django-http-cookie-value-none.patch', 'patch/django-cookie-delete-with-all-settings.patch', + 'patch/tastypie-django22-fielderror-response.patch', ] if DEBUG: try: diff --git a/patch/tastypie-django22-fielderror-response.patch b/patch/tastypie-django22-fielderror-response.patch new file mode 100644 index 000000000..5443ce65f --- /dev/null +++ b/patch/tastypie-django22-fielderror-response.patch @@ -0,0 +1,20 @@ +--- tastypie/resources.py.orig 2020-08-24 13:14:25.463166100 +0200 ++++ tastypie/resources.py 2020-08-24 13:15:55.133759224 +0200 +@@ -15,7 +15,7 @@ + ObjectDoesNotExist, MultipleObjectsReturned, ValidationError, FieldDoesNotExist + ) + from django.core.signals import got_request_exception +-from django.core.exceptions import ImproperlyConfigured ++from django.core.exceptions import ImproperlyConfigured, FieldError + from django.db.models.fields.related import ForeignKey + try: + from django.contrib.gis.db.models.fields import GeometryField +@@ -2207,6 +2207,8 @@ + return self.authorized_read_list(objects, bundle) + except ValueError: + raise BadRequest("Invalid resource lookup data provided (mismatched type).") ++ except FieldError as e: ++ raise BadRequest("Invalid resource lookup: %s." % e) + + def obj_get(self, bundle, **kwargs): + """