2020-04-17 15:35:24 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# Generated by Django 1.11.28 on 2020-04-16 22:31
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
('users', '0084_auto_20191120_0159'),
|
|
|
|
]
|
|
|
|
|
2020-04-17 15:37:47 +00:00
|
|
|
def flag_verified(apps, schema_editor):
|
|
|
|
db_alias = schema_editor.connection.alias
|
|
|
|
users = apps.get_model("users", "User")
|
|
|
|
users.objects.using(db_alias).all().update(email_state=0)
|
|
|
|
|
2020-04-17 15:42:23 +00:00
|
|
|
def undo_flag_verified(apps, schema_editor):
|
|
|
|
return
|
|
|
|
|
2020-04-17 15:35:24 +00:00
|
|
|
operations = [
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='user',
|
|
|
|
name='email_state',
|
|
|
|
field=models.IntegerField(choices=[(0, 'Verified'), (1, 'Unverified'), (2, 'Waiting for email confirmation')], default=2),
|
|
|
|
),
|
2020-04-17 15:42:23 +00:00
|
|
|
migrations.RunPython(flag_verified, undo_flag_verified),
|
2020-04-17 15:35:24 +00:00
|
|
|
]
|