From bf754369d9e01b60dd21a0c910d62fcddd05fcf5 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 9 Feb 2021 21:01:39 +0100 Subject: [PATCH] providers/proxy: fix certificates without key being selectable --- authentik/core/api/tokens.py | 6 +++--- authentik/providers/proxy/forms.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/authentik/core/api/tokens.py b/authentik/core/api/tokens.py index 5be8478da..25422d5d3 100644 --- a/authentik/core/api/tokens.py +++ b/authentik/core/api/tokens.py @@ -49,7 +49,7 @@ class TokenViewSet(ModelViewSet): if not tokens.exists(): raise Http404 token = tokens.first() - Event.new( # noqa # nosec - EventAction.SECRET_VIEW, secret=token - ).from_http(request) + Event.new(EventAction.SECRET_VIEW, secret=token).from_http( # noqa # nosec + request + ) return Response(TokenViewSerializer({"key": token.key}).data) diff --git a/authentik/providers/proxy/forms.py b/authentik/providers/proxy/forms.py index 2c3277253..e1433d6bc 100644 --- a/authentik/providers/proxy/forms.py +++ b/authentik/providers/proxy/forms.py @@ -18,7 +18,7 @@ class ProxyProviderForm(forms.ModelForm): ) self.fields["certificate"].queryset = CertificateKeyPair.objects.filter( key_data__isnull=False - ) + ).exclude(key_data="") def save(self, *args, **kwargs): actual_save = super().save(*args, **kwargs)