Commit 7bda48bd authored by 八千流's avatar 八千流 Committed by 老广

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

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

* [Bugfix] 修改小问题
parent 63a502ba
...@@ -46,7 +46,6 @@ class AuthMixin: ...@@ -46,7 +46,6 @@ class AuthMixin:
if self.can_update_password(): if self.can_update_password():
self.date_password_last_updated = timezone.now() self.date_password_last_updated = timezone.now()
super().set_password(raw_password) super().set_password(raw_password)
self.save()
else: else:
error = _("User auth from {}, go there change password").format( error = _("User auth from {}, go there change password").format(
self.source) self.source)
...@@ -84,6 +83,7 @@ class AuthMixin: ...@@ -84,6 +83,7 @@ class AuthMixin:
def reset_password(self, new_password): def reset_password(self, new_password):
self.set_password(new_password) self.set_password(new_password)
self.save()
@property @property
def date_password_expired(self): def date_password_expired(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment