added user type

This commit is contained in:
Hubert Jankowski 2022-05-15 23:48:11 +02:00
parent cff6de1dc0
commit 5e9d26ff8e

View File

@ -5,6 +5,15 @@ from .managers import UserManager
class User(AbstractBaseUser): class User(AbstractBaseUser):
ADMIN = "admin"
STANDARD = "standard"
USER_TYPES = (
("admin", ADMIN),
("standard", STANDARD),
)
first_name = models.CharField(max_length=100) first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100)
@ -14,6 +23,7 @@ class User(AbstractBaseUser):
confirmation_number = models.CharField(max_length=100) confirmation_number = models.CharField(max_length=100)
reset_code = models.IntegerField(null=True) reset_code = models.IntegerField(null=True)
avatar = models.ImageField(upload_to="avatars/", null=True) avatar = models.ImageField(upload_to="avatars/", null=True)
type = models.CharField(choices=USER_TYPES, default=STANDARD, max_length=100)
USERNAME_FIELD = "email" USERNAME_FIELD = "email"