mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-27 07:02:26 +00:00
Provide default value for email_change_date and don't allow it to be null
This commit is contained in:
parent
154096050c
commit
cdd9dfae6c
2 changed files with 24 additions and 1 deletions
23
users/migrations/0088_auto_20200417_2312.py
Normal file
23
users/migrations/0088_auto_20200417_2312.py
Normal 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,
|
||||
),
|
||||
]
|
|
@ -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"]
|
||||
|
|
Loading…
Reference in a new issue