Skip to content

Commit

Permalink
save only updated fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Akay7 committed Jul 27, 2022
1 parent 6315e25 commit 04646f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions allauth/account/models.py
Expand Up @@ -48,7 +48,7 @@ def set_as_primary(self, conditional=False):
self.primary = True
self.save()
user_email(self.user, self.email)
self.user.save()
self.user.save(update_fields=[app_settings.USER_MODEL_EMAIL_FIELD])
return True

def send_confirmation(self, request=None, signup=False):
Expand All @@ -65,7 +65,7 @@ def change(self, request, new_email, confirm=True):
"""
with transaction.atomic():
user_email(self.user, new_email)
self.user.save()
self.user.save(update_fields=[app_settings.USER_MODEL_EMAIL_FIELD])
self.email = new_email
self.verified = False
self.save()
Expand Down

0 comments on commit 04646f8

Please sign in to comment.