[Bugfix] 修复创建用户 数据库报1062 Duplicate entry .. for key PRIMARY 错误 (#2934)

* [Bugfix] 修复创建用户 数据报1062 Duplicate entry .. for key PRIMARY 错误

* [Bugfix] 修改小问题
pull/2942/head
八千流 2019-07-12 15:43:36 +08:00 committed by 老广
parent 63a502ba62
commit 7bda48bd9f
1 changed files with 1 additions and 1 deletions

View File

@ -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):