From a26f25ccd61202e92ca48cede18fb155c65f69a2 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 23 May 2022 20:17:52 +0200 Subject: [PATCH] events: ignore silk SQLQuery object Signed-off-by: Jens Langhammer --- authentik/events/middleware.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/authentik/events/middleware.py b/authentik/events/middleware.py index 0c9be762c..fc98b09b5 100644 --- a/authentik/events/middleware.py +++ b/authentik/events/middleware.py @@ -25,10 +25,12 @@ IGNORED_MODELS = [ AuthenticatedSession, StaticToken, ] -if settings.DEBUG: - from silk.models import Request, Response +try: + from silk.models import Request, Response, SQLQuery - IGNORED_MODELS += [Request, Response] + IGNORED_MODELS += [Request, Response, SQLQuery] +except ImportError: + pass IGNORED_MODELS = tuple(IGNORED_MODELS)