diff --git a/sentry_sdk/integrations/django/views.py b/sentry_sdk/integrations/django/views.py index d9d3ba95b3..c1034d0d85 100644 --- a/sentry_sdk/integrations/django/views.py +++ b/sentry_sdk/integrations/django/views.py @@ -26,6 +26,7 @@ def patch_views(): from django.template.response import SimpleTemplateResponse from sentry_sdk.integrations.django import DjangoIntegration + old_make_view_atomic = BaseHandler.make_view_atomic old_render = SimpleTemplateResponse.render def sentry_patched_render(self): @@ -36,10 +37,6 @@ def sentry_patched_render(self): ): return old_render(self) - SimpleTemplateResponse.render = sentry_patched_render - - old_make_view_atomic = BaseHandler.make_view_atomic - @_functools.wraps(old_make_view_atomic) def sentry_patched_make_view_atomic(self, *args, **kwargs): # type: (Any, *Any, **Any) -> Any @@ -66,6 +63,7 @@ def sentry_patched_make_view_atomic(self, *args, **kwargs): return sentry_wrapped_callback + SimpleTemplateResponse.render = sentry_patched_render BaseHandler.make_view_atomic = sentry_patched_make_view_atomic