registration_backend/forms: do not overwrite the username if it's a field of the form

This commit is contained in:
Benjamin Dauvergne 2015-04-30 10:16:33 +02:00
parent 246843f958
commit 0aa54d1af7
1 changed files with 1 additions and 1 deletions

View File

@ -157,7 +157,7 @@ class RegistrationCompletionForm(forms.UserAttributeFormMixin, Form):
continue
if field.startswith('password'):
continue
if field == 'username':
if field == 'username' and not self.cleaned_data.get('username'):
kwargs[field] = uuid4().get_hex()[:30]
user_fields[field] = kwargs[field]
if field == 'email':