From c21e343986d4ad5ecb5c3e2ed9ca25e860b76142 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 5 Jul 2019 15:59:52 +0200 Subject: [PATCH] oidc_provider: fix error when creating a new provider --- passbook/oidc_provider/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()