diff --git a/greg/migrations/0001_initial.py b/greg/migrations/0001_initial.py index c21f8d54057357e12771c55927a8001ce9cd2b0b..7504a4e320ce449103f0aa674c34a41fbef8f1da 100644 --- a/greg/migrations/0001_initial.py +++ b/greg/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.2.5 on 2021-08-04 10:40 +# Generated by Django 3.2.5 on 2021-08-04 11:07 import datetime import dirtyfields.dirtyfields @@ -158,7 +158,7 @@ class Migration(migrations.Migration): ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), - ('type', models.CharField(choices=[('PASSPORT_NUMBER', 'Passport Number'), ('FEIDE_ID', 'Feide Id')], max_length=15)), + ('type', models.CharField(choices=[('ID_PORTEN', 'Id Porten'), ('FEIDE_ID', 'Feide Id'), ('PASSPORT', 'Passport'), ('DRIVERS_LICENSE', 'Drivers License'), ('NATIONAL_ID_CARD', 'National Id Card'), ('OTHER', 'Other')], max_length=16)), ('source', models.CharField(max_length=256)), ('value', models.CharField(max_length=256)), ('verified', models.CharField(blank=True, choices=[('AUTOMATIC', 'Automatic'), ('MANUAL', 'Manual')], max_length=9)), diff --git a/greg/models.py b/greg/models.py index 5b47b41e22e4e0460457c0a43e2ee1d7dac15a37..73e5369760975e089e7f9f2243996f6d402260ef 100644 --- a/greg/models.py +++ b/greg/models.py @@ -131,10 +131,14 @@ class Notification(BaseModel): class PersonIdentity(BaseModel): - # TODO: Add more types class IdentityType(models.TextChoices): - PASSPORT_NUMBER = "PASSPORT_NUMBER" + ID_PORTEN = "ID_PORTEN" FEIDE_ID = "FEIDE_ID" + PASSPORT = "PASSPORT" + DRIVERS_LICENSE = "DRIVERS_LICENSE" + NATIONAL_ID_CARD = "NATIONAL_ID_CARD" + # Sponsor writes what is used in the value column + OTHER = "OTHER" class Verified(models.TextChoices): AUTOMATIC = "AUTOMATIC" @@ -143,7 +147,7 @@ class PersonIdentity(BaseModel): person = models.ForeignKey( "Person", on_delete=models.PROTECT, related_name="person" ) - type = models.CharField(max_length=15, choices=IdentityType.choices) + type = models.CharField(max_length=16, choices=IdentityType.choices) source = models.CharField(max_length=256) value = models.CharField(max_length=256) verified = models.CharField(max_length=9, choices=Verified.choices, blank=True)