compat: honor DEBUG_PROPAGATE_EXCEPTIONS in Django compatibility views (#73489)
This commit is contained in:
parent
7d04a96a07
commit
77ac56cf2f
|
@ -74,6 +74,10 @@ class TemplateWithFallbackView(TemplateView):
|
|||
context = {'body': get_publisher().finish_interrupted_request(exc)}
|
||||
self.quixote_response = get_request().response
|
||||
except Exception:
|
||||
# Follow native django DEBUG_PROPAGATE_EXCEPTIONS setting, re-raise exception
|
||||
# so it can be caught/stopped at when running tests.
|
||||
if settings.DEBUG_PROPAGATE_EXCEPTIONS:
|
||||
raise
|
||||
context = {'body': get_publisher().finish_failed_request()}
|
||||
self.quixote_response = get_request().response
|
||||
|
||||
|
@ -215,6 +219,10 @@ class CompatWcsPublisher(WcsPublisher):
|
|||
except PublishError as exc:
|
||||
output = self.finish_interrupted_request(exc)
|
||||
except Exception:
|
||||
# Follow native django DEBUG_PROPAGATE_EXCEPTIONS setting, re-raise exception
|
||||
# so it can be caught/stopped at when running tests.
|
||||
if settings.DEBUG_PROPAGATE_EXCEPTIONS:
|
||||
raise
|
||||
output = self.finish_failed_request()
|
||||
response = request.response
|
||||
|
||||
|
|
Loading…
Reference in New Issue