misc: dont mutate dictionnary during iteration (#44869)

This commit is contained in:
Benjamin Dauvergne 2020-07-06 20:55:04 +02:00
parent 901f9af326
commit d78ce337ec
1 changed files with 1 additions and 1 deletions

View File

@ -437,7 +437,7 @@ class AppConfig(django.apps.AppConfig):
form.initial['preferred_givenname'] = view.token.get('first_name', '')
form.fields['preferred_givenname'].widget = HiddenInput()
for name in form.fields:
for name in list(form.fields):
if 'password' not in name and name not in ('preferred_username', 'preferred_givenname'):
form.fields.pop(name)