From 1f192146e97b5e5e007f1e64fa9826d90c174ac5 Mon Sep 17 00:00:00 2001 From: Daniel Szoke Date: Mon, 9 Sep 2024 17:59:04 +0200 Subject: [PATCH] fix(django): Add `sync_capable` to `SentryWrappingMiddleware` Fixes #3506 --- sentry_sdk/integrations/django/middleware.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sentry_sdk/integrations/django/middleware.py b/sentry_sdk/integrations/django/middleware.py index 981d192864..2cde251fd3 100644 --- a/sentry_sdk/integrations/django/middleware.py +++ b/sentry_sdk/integrations/django/middleware.py @@ -125,6 +125,7 @@ def sentry_wrapped_method(*args, **kwargs): class SentryWrappingMiddleware( _asgi_middleware_mixin_factory(_check_middleware_span) # type: ignore ): + sync_capable = getattr(middleware, "sync_capable", True) async_capable = DJANGO_SUPPORTS_ASYNC_MIDDLEWARE and getattr( middleware, "async_capable", False )