Skip to content

Commit ce6590a

Browse files
committed
more wraps
1 parent 4c9d303 commit ce6590a

File tree

1 file changed

+4
-0
lines changed
  • sentry_sdk/integrations/django

1 file changed

+4
-0
lines changed

sentry_sdk/integrations/django/asgi.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def patch_django_asgi_handler_impl(cls):
8888

8989
old_app = cls.__call__
9090

91+
@functools.wraps(old_app)
9192
async def sentry_patched_asgi_handler(self, scope, receive, send):
9293
# type: (Any, Any, Any, Any) -> Any
9394
integration = sentry_sdk.get_client().get_integration(DjangoIntegration)
@@ -109,6 +110,7 @@ async def sentry_patched_asgi_handler(self, scope, receive, send):
109110
if modern_django_asgi_support:
110111
old_create_request = cls.create_request
111112

113+
@functools.wrap(old_create_request)
112114
@ensure_integration_enabled(DjangoIntegration, old_create_request)
113115
def sentry_patched_create_request(self, *args, **kwargs):
114116
# type: (Any, *Any, **Any) -> Any
@@ -125,6 +127,7 @@ def patch_get_response_async(cls, _before_get_response):
125127
# type: (Any, Any) -> None
126128
old_get_response_async = cls.get_response_async
127129

130+
@functools.wraps(old_get_response_async)
128131
async def sentry_patched_get_response_async(self, request):
129132
# type: (Any, Any) -> Union[HttpResponse, BaseException]
130133
_before_get_response(request)
@@ -142,6 +145,7 @@ def patch_channels_asgi_handler_impl(cls):
142145
if channels.__version__ < "3.0.0":
143146
old_app = cls.__call__
144147

148+
@functools.wraps(old_app)
145149
async def sentry_patched_asgi_handler(self, receive, send):
146150
# type: (Any, Any, Any) -> Any
147151
integration = sentry_sdk.get_client().get_integration(DjangoIntegration)

0 commit comments

Comments
 (0)