From 5931b5d77838f0bb9f5874bb530fd3048329472f Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Tue, 25 Aug 2020 13:30:01 +0000 Subject: [PATCH] Added another tastypie patch - Legacy-Id: 18411 --- patch/tastypie-django22-fielderror-response.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/patch/tastypie-django22-fielderror-response.patch b/patch/tastypie-django22-fielderror-response.patch index 5443ce65f..bb4decd75 100644 --- a/patch/tastypie-django22-fielderror-response.patch +++ b/patch/tastypie-django22-fielderror-response.patch @@ -18,3 +18,15 @@ def obj_get(self, bundle, **kwargs): """ +--- tastypie/paginator.py.orig 2020-08-25 15:24:46.391588425 +0200 ++++ tastypie/paginator.py 2020-08-25 15:24:53.591797122 +0200 +@@ -128,6 +128,8 @@ + except (AttributeError, TypeError): + # If it's not a QuerySet (or it's ilk), fallback to ``len``. + return len(self.objects) ++ except ValueError as e: ++ raise BadRequest("Invalid resource lookup: %s." % e) + + def get_previous(self, limit, offset): + """ +