From d18e829d80e6108bdeead8fa014f2b45b4b5f21b Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 9 Aug 2021 20:47:26 +0200 Subject: [PATCH] providers/ldap: fix error in outpost when certificate is configured Signed-off-by: Jens Langhammer --- authentik/providers/ldap/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/authentik/providers/ldap/models.py b/authentik/providers/ldap/models.py index b041b8e07..d3be0883d 100644 --- a/authentik/providers/ldap/models.py +++ b/authentik/providers/ldap/models.py @@ -78,7 +78,10 @@ class LDAPProvider(OutpostModel, Provider): return f"LDAP Provider {self.name}" def get_required_objects(self) -> Iterable[Union[models.Model, str]]: - return [self, "authentik_core.view_user", "authentik_core.view_group"] + required_models = [self, "authentik_core.view_user", "authentik_core.view_group"] + if self.certificate is not None: + required_models.append(self.certificate) + return required_models class Meta: