Code

Ticket #18666: t18666-auth-save.diff

File t18666-auth-save.diff, 500 bytes (added by Alex, 2 years ago)
Line 
1diff --git a/django/contrib/auth/models.py b/django/contrib/auth/models.py
2index 39d9e84..1099aa1 100644
3--- a/django/contrib/auth/models.py
4+++ b/django/contrib/auth/models.py
5@@ -299,7 +299,7 @@ class User(models.Model):
6         """
7         def setter(raw_password):
8             self.set_password(raw_password)
9-            self.save()
10+            self.save(update_fields=["password"])
11         return check_password(raw_password, self.password, setter)
12 
13     def set_unusable_password(self):