update erd db and add display name to user access table

This commit is contained in:
Alberto-Audrix committed 2026-09-10 10:50:42 +07:00
1 parent ed84d989b7
commit ae2ea27ae2
13 files changed
+91 -10

No files matched your search

+2
View File
@@ -13,6 +13,7 @@ class UserManager(BaseUserManager):
if not user_name:
raise ValueError("user_name is required")
extra_fields.setdefault("status", User.STATUS_ACTIVE)
extra_fields.setdefault("display_name", user_name)
user = self.model(user_name=user_name, **extra_fields)
user.set_password(password)
user.save(using=self._db)
@@ -39,6 +40,7 @@ class User(AbstractBaseUser, PermissionsMixin):
user_id = models.BigAutoField(primary_key=True)
user_name = models.CharField(max_length=30, unique=True)
display_name = models.CharField(max_length=100)
status = models.CharField(max_length=30, choices=STATUS_CHOICES, default=STATUS_ACTIVE)
is_staff = models.BooleanField(default=False)
is_active = models.BooleanField(default=True)