I don’t get how the Abstract User is configured even after reading the Django documentation, please can I get any help
are you find user code?
from django.db import models
from django.contrib.auth.models import AbstractUser, UserManager
# Create your models here.
class UnverifiedUsersManager(models.Manager):
def get_queryset(self):
return super().get_queryset().filter(as_student__isnull=True, as_teacher__isnull=True, is_superuser=False)
class SimpleUser(AbstractUser):
first_name = models.CharField(max_length=256, verbose_name="Name")
last_name = models.CharField(max_length=256, verbose_name="Surname")
phone_number = models.CharField(max_length=256, verbose_name="Phone number", unique=True)
objects = UserManager()
unverified = UnverifiedUsersManager()
USERNAME_FIELD = 'phone_number'