From 7bda48bd9fa72ca435667ef27bff3efb766bcefd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AB=E5=8D=83=E6=B5=81?= <40739051+jym503558564@users.noreply.github.com> Date: Fri, 12 Jul 2019 15:43:36 +0800 Subject: [PATCH] =?UTF-8?q?[Bugfix]=20=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E7=94=A8=E6=88=B7=20=E6=95=B0=E6=8D=AE=E5=BA=93=E6=8A=A51062?= =?UTF-8?q?=20Duplicate=20entry=20..=20for=20key=20PRIMARY=20=E9=94=99?= =?UTF-8?q?=E8=AF=AF=20(#2934)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Bugfix] 修复创建用户 数据报1062 Duplicate entry .. for key PRIMARY 错误 * [Bugfix] 修改小问题 --- apps/users/models/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/users/models/user.py b/apps/users/models/user.py index 7b8395859..88abe4dd3 100644 --- a/apps/users/models/user.py +++ b/apps/users/models/user.py @@ -46,7 +46,6 @@ class AuthMixin: if self.can_update_password(): self.date_password_last_updated = timezone.now() super().set_password(raw_password) - self.save() else: error = _("User auth from {}, go there change password").format( self.source) @@ -84,6 +83,7 @@ class AuthMixin: def reset_password(self, new_password): self.set_password(new_password) + self.save() @property def date_password_expired(self):