auth_oidc: exclude last_sync_time from authn editable fields (#73227)

This commit is contained in:
Paul Marillonnet 2023-01-10 15:34:47 +01:00
parent 7e28aeec03
commit 789c1714d3
3 changed files with 5 additions and 1 deletions

View File

@ -18,6 +18,8 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='oidcprovider',
name='last_sync_time',
field=models.DateTimeField(blank=True, null=True, verbose_name='Last synchronization time'),
field=models.DateTimeField(
blank=True, null=True, verbose_name='Last synchronization time', editable=False
),
),
]

View File

@ -133,6 +133,7 @@ class OIDCProvider(BaseAuthenticator):
verbose_name=_('Last synchronization time'),
null=True,
blank=True,
editable=False,
)
# metadata

View File

@ -183,6 +183,7 @@ def test_authenticators_oidc(app, superuser, ou1, ou2):
resp = resp.click('Edit')
assert 'enabled' not in resp.form.fields
assert 'last_sync_time' not in resp.form.fields
assert resp.pyquery('input#id_client_id').val() == ''
assert resp.pyquery('input#id_client_secret').val() == ''
resp.form['ou'] = ou1.pk