From 743de7b4bf47004b9f429ee3be083076ec5f5d1d Mon Sep 17 00:00:00 2001 From: Tore Brede <Tore.Brede@uib.no> Date: Wed, 4 Aug 2021 15:14:39 +0200 Subject: [PATCH] Adding more verification types --- greg/migrations/0001_initial.py | 4 ++-- greg/models.py | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/greg/migrations/0001_initial.py b/greg/migrations/0001_initial.py index c21f8d54..7504a4e3 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 5b47b41e..73e53697 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) -- GitLab