providers/proxy: fix certificates without key being selectable
This commit is contained in:
parent
02dc112f8f
commit
bf754369d9
|
@ -49,7 +49,7 @@ class TokenViewSet(ModelViewSet):
|
||||||
if not tokens.exists():
|
if not tokens.exists():
|
||||||
raise Http404
|
raise Http404
|
||||||
token = tokens.first()
|
token = tokens.first()
|
||||||
Event.new( # noqa # nosec
|
Event.new(EventAction.SECRET_VIEW, secret=token).from_http( # noqa # nosec
|
||||||
EventAction.SECRET_VIEW, secret=token
|
request
|
||||||
).from_http(request)
|
)
|
||||||
return Response(TokenViewSerializer({"key": token.key}).data)
|
return Response(TokenViewSerializer({"key": token.key}).data)
|
||||||
|
|
|
@ -18,7 +18,7 @@ class ProxyProviderForm(forms.ModelForm):
|
||||||
)
|
)
|
||||||
self.fields["certificate"].queryset = CertificateKeyPair.objects.filter(
|
self.fields["certificate"].queryset = CertificateKeyPair.objects.filter(
|
||||||
key_data__isnull=False
|
key_data__isnull=False
|
||||||
)
|
).exclude(key_data="")
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
actual_save = super().save(*args, **kwargs)
|
actual_save = super().save(*args, **kwargs)
|
||||||
|
|
Reference in New Issue