Debian Codegraph @

allauth/account/migrations/0002_email_max_length.py

raw
1 from django.conf import settings
2 from django.db import migrations, models
3
4
5 UNIQUE_EMAIL = getattr(settings, "ACCOUNT_UNIQUE_EMAIL", True)
6 EMAIL_MAX_LENGTH = getattr(settings, "ACCOUNT_EMAIL_MAX_LENGTH", 254)
7
8
9 class Migration(migrations.Migration):
10 dependencies = [
11 ("account", "0001_initial"),
12 ]
13
14 operations = [
15 migrations.AlterField(
16 model_name="emailaddress",
17 name="email",
18 field=models.EmailField(
19 unique=UNIQUE_EMAIL,
20 max_length=EMAIL_MAX_LENGTH,
21 verbose_name="email address",
22 ),
23 ),
24 ]
25
26 if not UNIQUE_EMAIL:
27 operations += [
28 migrations.AlterUniqueTogether(
29 name="emailaddress",
30 unique_together={("user", "email")},
31 ),
32 ]