From 590c7f4c9d0067c98b8620e3673b10b903b3fa60 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 20 May 2021 18:07:07 +0200 Subject: [PATCH] outposts: fix error on outpost disconnect Signed-off-by: Jens Langhammer --- authentik/outposts/channels.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/authentik/outposts/channels.py b/authentik/outposts/channels.py index 59f8430b6..d0dad47b8 100644 --- a/authentik/outposts/channels.py +++ b/authentik/outposts/channels.py @@ -65,8 +65,9 @@ class OutpostConsumer(AuthJsonConsumer): def disconnect(self, close_code): if self.outpost and self.last_uid: state = OutpostState.for_instance_uid(self.outpost, self.last_uid) - state.channel_ids.remove(self.channel_name) - state.save() + if self.channel_name in state.channel_ids: + state.channel_ids.remove(self.channel_name) + state.save() LOGGER.debug( "removed outpost instance from cache", outpost=self.outpost,