修改用户管理

This commit is contained in:
xuyue committed 2025-03-04 11:41:55 +08:00
1 parent 6ac81045af
commit 782986aa14
14 files changed
+149 -8

No files matched your search

+12
View File
@@ -14,4 +14,16 @@ class User(AbstractUser):
max_length=20,
choices=RoleChoices.choices,
default=RoleChoices.NORMAL,
verbose_name="权限",
)
raw_password = models.CharField(
max_length=20,
null=True,
blank=True,
verbose_name="明文密码",
)
def set_password(self, raw_password):
super().set_password(raw_password)
self.raw_password = raw_password
self.save()