# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2018-05-20 12:42
from __future__ import unicode_literals

from django.db import migrations, models

from fotopruvodce.core.models import hash_email


def hash_emails(apps, schema_editor):
    User = apps.get_model('auth', 'User')
    for user in User.objects.all():
        if user.email:
            email = user.email
            user.email = ''
            user.save()
            user.profile.email_hash = hash_email(email)
            user.profile.save()


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0005_add_custom_css'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='userprofile',
            name='displayed_email',
        ),
        migrations.AddField(
            model_name='userprofile',
            name='email_hash',
            field=models.CharField(blank=True, max_length=256),
        ),
        migrations.RunPython(
            hash_emails
        ),
        migrations.RunSQL(
            "UPDATE auth_user SET first_name='', last_name='', email='';"
        ),
    ]

78855d95b0e76cf9aacf63a97816ca77fbe00a35
<mask token>


class Migration(migrations.Migration):
    <mask token>
    <mask token>

<mask token>


class Migration(migrations.Migration):
    dependencies = [('core', '0005_add_custom_css')]
    operations = [migrations.RemoveField(model_name='userprofile', name=
        'displayed_email'), migrations.AddField(model_name='userprofile',
        name='email_hash', field=models.CharField(blank=True, max_length=
        256)), migrations.RunPython(hash_emails), migrations.RunSQL(
        "UPDATE auth_user SET first_name='', last_name='', email='';")]

<mask token>


def hash_emails(apps, schema_editor):
    User = apps.get_model('auth', 'User')
    for user in User.objects.all():
        if user.email:
            email = user.email
            user.email = ''
            user.save()
            user.profile.email_hash = hash_email(email)
            user.profile.save()


class Migration(migrations.Migration):
    dependencies = [('core', '0005_add_custom_css')]
    operations = [migrations.RemoveField(model_name='userprofile', name=
        'displayed_email'), migrations.AddField(model_name='userprofile',
        name='email_hash', field=models.CharField(blank=True, max_length=
        256)), migrations.RunPython(hash_emails), migrations.RunSQL(
        "UPDATE auth_user SET first_name='', last_name='', email='';")]

from __future__ import unicode_literals
from django.db import migrations, models
from fotopruvodce.core.models import hash_email


def hash_emails(apps, schema_editor):
    User = apps.get_model('auth', 'User')
    for user in User.objects.all():
        if user.email:
            email = user.email
            user.email = ''
            user.save()
            user.profile.email_hash = hash_email(email)
            user.profile.save()


class Migration(migrations.Migration):
    dependencies = [('core', '0005_add_custom_css')]
    operations = [migrations.RemoveField(model_name='userprofile', name=
        'displayed_email'), migrations.AddField(model_name='userprofile',
        name='email_hash', field=models.CharField(blank=True, max_length=
        256)), migrations.RunPython(hash_emails), migrations.RunSQL(
        "UPDATE auth_user SET first_name='', last_name='', email='';")]

# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2018-05-20 12:42
from __future__ import unicode_literals

from django.db import migrations, models

from fotopruvodce.core.models import hash_email


def hash_emails(apps, schema_editor):
    User = apps.get_model('auth', 'User')
    for user in User.objects.all():
        if user.email:
            email = user.email
            user.email = ''
            user.save()
            user.profile.email_hash = hash_email(email)
            user.profile.save()


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0005_add_custom_css'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='userprofile',
            name='displayed_email',
        ),
        migrations.AddField(
            model_name='userprofile',
            name='email_hash',
            field=models.CharField(blank=True, max_length=256),
        ),
        migrations.RunPython(
            hash_emails
        ),
        migrations.RunSQL(
            "UPDATE auth_user SET first_name='', last_name='', email='';"
        ),
    ]
