From 39ff202f8c6fb73d73fc890a76f1478bbc3b1200 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 3 Feb 2022 17:58:54 +0100 Subject: [PATCH] outposts: fix channel not always having a logger attribute Signed-off-by: Jens Langhammer --- authentik/outposts/channels.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/authentik/outposts/channels.py b/authentik/outposts/channels.py index 64bf11be0..194cd6806 100644 --- a/authentik/outposts/channels.py +++ b/authentik/outposts/channels.py @@ -55,6 +55,10 @@ class OutpostConsumer(AuthJsonConsumer): first_msg = False + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.logger = get_logger() + def connect(self): super().connect() uuid = self.scope["url_route"]["kwargs"]["pk"] @@ -65,7 +69,7 @@ class OutpostConsumer(AuthJsonConsumer): ) if not outpost: raise DenyConnection() - self.logger = get_logger().bind(outpost=outpost) + self.logger = self.logger.bind(outpost=outpost) try: self.accept() except RuntimeError as exc: