Skip to content
Snippets Groups Projects
Commit fdbca63c authored by Dorian Lesbre's avatar Dorian Lesbre
Browse files

Fix issue #6

parent b1644288
No related branches found
No related tags found
No related merge requests found
......@@ -54,10 +54,8 @@ class UpdateAccountForm(FormRenderMixin, forms.ModelForm):
return norm_email
def save(self, *args, commit=True, **kwargs):
email = self.cleaned_data["email"]
email_changed = email != self.instance.username
email_changed = "email" in self.changed_data
user = super().save(*args, commit=False, **kwargs)
user.username = email
if email_changed:
user.email_confirmed = False
user.is_active = False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment