8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 11:23:10 +00:00

Provide default value for email_change_date and don't allow it to be null

This commit is contained in:
Jean-Romain Garnier 2020-04-17 21:13:16 +00:00 committed by Supelec Rezo Rennes
parent 6620d14fc5
commit 93dcc79cad
2 changed files with 24 additions and 1 deletions

View file

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.28 on 2020-04-17 21:12
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('users', '0087_request_email'),
]
operations = [
migrations.AlterField(
model_name='user',
name='email_change_date',
field=models.DateTimeField(auto_now_add=True, default=datetime.datetime(2020, 4, 17, 21, 12, 19, 739799, tzinfo=utc)),
preserve_default=False,
),
]

View file

@ -238,7 +238,7 @@ class User(
shortcuts_enabled = models.BooleanField(
verbose_name=_("enable shortcuts on Re2o website"), default=True
)
email_change_date = models.DateTimeField(default=None, null=True)
email_change_date = models.DateTimeField(auto_now_add=True)
USERNAME_FIELD = "pseudo"
REQUIRED_FIELDS = ["surname", "email"]