diff --git a/codeforlife/user/migrations/0001_initial.py b/codeforlife/user/migrations/0001_initial.py index 48b10cf..2b700d2 100644 --- a/codeforlife/user/migrations/0001_initial.py +++ b/codeforlife/user/migrations/0001_initial.py @@ -1,8 +1,7 @@ -# Generated by Django 3.2.24 on 2024-04-10 14:01 +# Generated by Django 3.2.24 on 2024-04-15 10:04 import codeforlife.user.models.user import django.contrib.auth.models -import django.core.validators from django.db import migrations, models import django.db.models.deletion @@ -12,8 +11,8 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('common', '0048_unique_school_names'), ('auth', '0012_alter_user_first_name_max_length'), + ('common', '0048_unique_school_names'), ] operations = [ @@ -82,9 +81,13 @@ class Migration(migrations.Migration): name='OtpBypassToken', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('token', models.CharField(max_length=8, validators=[django.core.validators.MinLengthValidator(8)])), + ('token', models.CharField(max_length=8, verbose_name='token')), ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='otp_bypass_tokens', to='user.user')), ], + options={ + 'verbose_name': 'OTP bypass token', + 'verbose_name_plural': 'OTP bypass tokens', + }, ), migrations.CreateModel( name='AuthFactor', diff --git a/codeforlife/user/models/otp_bypass_token.py b/codeforlife/user/models/otp_bypass_token.py index dd97ab8..bffda94 100644 --- a/codeforlife/user/models/otp_bypass_token.py +++ b/codeforlife/user/models/otp_bypass_token.py @@ -75,7 +75,6 @@ def bulk_create(self, user: User): # type: ignore[override] class Meta(TypedModelMeta): verbose_name = _("OTP bypass token") verbose_name_plural = _("OTP bypass tokens") - unique_together = ("user", "token") def save(self, *args, **kwargs): raise IntegrityError("Cannot create or update a single instance.")