oidc_provider: fix error when creating a new provider

This commit is contained in:
Jens Langhammer 2019-07-05 15:59:52 +02:00
parent ff37ed095c
commit c21e343986

View file

@ -13,7 +13,7 @@ class OIDCProviderForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
# Correctly load data from 1:1 rel
if 'instance' in kwargs:
if 'instance' in kwargs and kwargs['instance']:
kwargs['instance'] = kwargs['instance'].oidc_client
super().__init__(*args, **kwargs)
self.fields['client_id'].initial = generate_client_id()