core: fix saving of policy not correctly clearing it's cache

This commit is contained in:
Jens Langhammer
2020-02-24 13:15:27 +01:00
parent f8599438df
commit 4daa70c894
3 changed files with 15 additions and 8 deletions

View File

@ -19,6 +19,8 @@ class OIDCProviderForm(forms.ModelForm):
self.fields["client_secret"].initial = generate_client_secret()
def save(self, *args, **kwargs):
self.instance.reuse_consent = False # This is managed by passbook
self.instance.require_consent = True # This is managed by passbook
response = super().save(*args, **kwargs)
# Check if openidprovider class instance exists
if not OpenIDProvider.objects.filter(oidc_client=self.instance).exists():