修改用户管理

This commit is contained in:
2025-03-04 11:41:55 +08:00
parent 6ac81045af
commit 782986aa14
14 changed files with 149 additions and 8 deletions

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()