diff --git a/passbook/oidc_provider/forms.py b/passbook/oidc_provider/forms.py index 4b2f84ca2..23651bc3a 100644 --- a/passbook/oidc_provider/forms.py +++ b/passbook/oidc_provider/forms.py @@ -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()