Commit 338a9866 authored by Chris Lamb's avatar Chris Lamb
Browse files

Add a "email_validated" datetime field, grandfathering in old users. (re. #18)

parent 6bf1a1ff
# Generated by Django 2.0.5 on 2018-06-05 21:35
from django.db import migrations, models
def forwards_func(apps, schema_editor):
User = apps.get_model('account', 'User')
for x in User.objects.all():
x.email_validated = x.date_joined
x.save()
def reverse_func(apps, schema_editor):
pass
class Migration(migrations.Migration):
dependencies = [
('account', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='email_validated',
field=models.DateTimeField(null=True),
),
migrations.RunPython(forwards_func, reverse_func),
]
......@@ -6,6 +6,7 @@ from .managers import UserManager
class User(AbstractUser):
email = models.EmailField(unique=True)
email_validated = models.DateTimeField(null=True)
username = None
first_name = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment