From a82f25d59e6988d2771614afe85cd35f7aa5e045 Mon Sep 17 00:00:00 2001 From: Jori Lindell Date: Tue, 8 Aug 2023 13:42:07 +0300 Subject: [PATCH] Don't allow null value in email fields of RegistrationUser model --- registrations/migrations/0017_registrationuser.py | 9 ++------- registrations/models.py | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/registrations/migrations/0017_registrationuser.py b/registrations/migrations/0017_registrationuser.py index bf236b992..f3b80885f 100644 --- a/registrations/migrations/0017_registrationuser.py +++ b/registrations/migrations/0017_registrationuser.py @@ -1,4 +1,4 @@ -# Generated by Django 3.2.19 on 2023-07-05 07:54 +# Generated by Django 3.2.19 on 2023-08-08 10:33 from django.db import migrations, models import django.db.models.deletion @@ -23,12 +23,7 @@ class Migration(migrations.Migration): verbose_name="ID", ), ), - ( - "email", - models.EmailField( - blank=True, max_length=254, null=True, verbose_name="E-mail" - ), - ), + ("email", models.EmailField(max_length=254, verbose_name="E-mail")), ( "registration", models.ForeignKey( diff --git a/registrations/models.py b/registrations/models.py index 416fb4e4c..793c8f8e1 100644 --- a/registrations/models.py +++ b/registrations/models.py @@ -240,7 +240,7 @@ def is_user_editable_resources(self): class RegistrationUser(models.Model): - email = models.EmailField(verbose_name=_("E-mail"), null=True, blank=True) + email = models.EmailField(verbose_name=_("E-mail")) registration = models.ForeignKey( Registration, on_delete=models.CASCADE, related_name="registration_users"