Skip to content

Commit

Permalink
fix: Change User class in backend/models.py to use email as uniqu…
Browse files Browse the repository at this point in the history
…e field.
  • Loading branch information
James-Makela committed May 10, 2024
1 parent 8fc326c commit d88d168
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backend/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ def get_queryset(self):
class User(AbstractUser):
objects = CustomUserManager() # type: ignore

email = models.EmailField(max_length=150, unique=True)

USERNAME_FIELD = "email"
REQUIRED_FIELDS = ["username"]

logged_in_as_team = models.ForeignKey("Team", on_delete=models.SET_NULL, null=True, blank=True)
awaiting_email_verification = models.BooleanField(default=True)

Expand Down

0 comments on commit d88d168

Please sign in to comment.