I want to create a user whom I'm using as a ForeignKey and i don't want those users can login to system. I have no idea how to go on. (about setting set_unusable_password() or None, and how to perform it):
my accounts.py file is as
class User(AbstractBaseUser):
GENDER = (("MALE", "Male"), ("FEMALE", "Female"))
user_type = models.CharField(max_length=50, choices=Types.choices, default=Types.PATIENT)
full_name = models.CharField(max_length=255, blank=True, null=True)
phone = models.CharField(max_length=255, unique=True)
email = models.CharField(max_length=255, blank=True, null=True, unique=True)
active = models.BooleanField(default=False)
gender = models.CharField(max_length=15, choices=GENDER)
admin = models.BooleanField(default=False)
staff = models.BooleanField(default=False)
timestamp = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
USERNAME_FIELD = "phone" # username
REQUIRED_FIELDS = []
objects = UserManager()
thanks in advance guys. <3