mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #24455 -- Fixed crash in debug view with lazy objects
This commit is contained in:
@@ -186,7 +186,15 @@ class SafeExceptionReporterFilter(ExceptionReporterFilter):
|
||||
return request.POST
|
||||
|
||||
def cleanse_special_types(self, request, value):
|
||||
if isinstance(value, HttpRequest):
|
||||
try:
|
||||
# If value is lazy or a complex object of another kind, this check
|
||||
# might raise an exception. isinstance checks that lazy HttpRequests
|
||||
# or MultiValueDicts will have a return value.
|
||||
is_request = isinstance(value, HttpRequest)
|
||||
except Exception as e:
|
||||
return '{!r} while evaluating {!r}'.format(e, value)
|
||||
|
||||
if is_request:
|
||||
# Cleanse the request's POST parameters.
|
||||
value = self.get_request_repr(value)
|
||||
elif isinstance(value, MultiValueDict):
|
||||
|
||||
Reference in New Issue
Block a user