Makes the email field unique

clubs
Laurent 1 year ago
parent f60ce8f1f2
commit 75c209a1d8
  1. 18
      tournaments/migrations/0067_alter_customuser_email.py
  2. 1
      tournaments/models/custom_user.py

@ -0,0 +1,18 @@
# Generated by Django 4.2.11 on 2024-06-05 13:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tournaments', '0066_alter_club_broadcast_code'),
]
operations = [
migrations.AlterField(
model_name='customuser',
name='email',
field=models.EmailField(max_length=254, unique=True),
),
]

@ -6,6 +6,7 @@ import uuid
class CustomUser(AbstractUser):
pass
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=True)
email = models.EmailField(unique=True)
umpire_code = models.CharField(max_length=50, blank=True, null=True)
clubs = models.ManyToManyField(club.Club, blank=True)
phone = models.CharField(max_length=15, null=True, blank=True)

Loading…
Cancel
Save