diff --git a/authentik/events/middleware.py b/authentik/events/middleware.py index fc98b09b5..b0bd71ae6 100644 --- a/authentik/events/middleware.py +++ b/authentik/events/middleware.py @@ -25,12 +25,10 @@ IGNORED_MODELS = [ AuthenticatedSession, StaticToken, ] -try: +if settings.DEBUG: from silk.models import Request, Response, SQLQuery IGNORED_MODELS += [Request, Response, SQLQuery] -except ImportError: - pass IGNORED_MODELS = tuple(IGNORED_MODELS)