From b119bfeb652484d12255041928c6ec434ca58427 Mon Sep 17 00:00:00 2001 From: Jean-Romain Garnier Date: Tue, 21 Apr 2020 16:31:26 +0000 Subject: [PATCH] Prevent user email from being null --- users/migrations/0090_auto_20200421_1825.py | 20 ++++++++++++++++++++ users/models.py | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 users/migrations/0090_auto_20200421_1825.py diff --git a/users/migrations/0090_auto_20200421_1825.py b/users/migrations/0090_auto_20200421_1825.py new file mode 100644 index 00000000..3a659d46 --- /dev/null +++ b/users/migrations/0090_auto_20200421_1825.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.28 on 2020-04-21 16:25 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0089_auto_20200418_0112'), + ] + + operations = [ + migrations.AlterField( + model_name='user', + name='email', + field=models.EmailField(blank=True, default='', help_text='External email address allowing us to contact you.', max_length=254), + ), + ] diff --git a/users/models.py b/users/models.py index 42df3f5a..805e8b69 100755 --- a/users/models.py +++ b/users/models.py @@ -206,7 +206,7 @@ class User( ) email = models.EmailField( blank=True, - null=True, + default="", help_text=_("External email address allowing us to contact you."), ) local_email_redirect = models.BooleanField(