from __future__ import unicode_literals

from django.db import migrations


def forwards_func(apps, schema_editor):
    User = apps.get_model("auth", "User")

    for user in User.objects.all():
        user.emails.update(email=user.email)


class Migration(migrations.Migration):

    dependencies = [
        ('customer', '0004_auto_20170413_1853'),
    ]

    operations = [
        migrations.RunPython(forwards_func)
    ]

from __future__ import unicode_literals

from django.db import migrations

from oscar.core.compat import get_user_model

User = get_user_model()


def forwards_func(apps, schema_editor):
    for user in User.objects.all():
        user.emails.update(email=user.email)


class Migration(migrations.Migration):

    dependencies = [
        ('customer', '0004_auto_20170413_1853'),
    ]

    operations = [
        migrations.RunPython(forwards_func)
    ]

Load current User model for customer email migration.
Load current User model for customer email migration.

  from __future__ import unicode_literals
  
  from django.db import migrations
  
+ from oscar.core.compat import get_user_model
+ 
+ User = get_user_model()
+ 
  
  def forwards_func(apps, schema_editor):
-     User = apps.get_model("auth", "User")
- 
      for user in User.objects.all():
          user.emails.update(email=user.email)
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('customer', '0004_auto_20170413_1853'),
      ]
  
      operations = [
          migrations.RunPython(forwards_func)
      ]
  
Load current User model for customer email migration.
## Code Before:
from __future__ import unicode_literals

from django.db import migrations


def forwards_func(apps, schema_editor):
    User = apps.get_model("auth", "User")

    for user in User.objects.all():
        user.emails.update(email=user.email)


class Migration(migrations.Migration):

    dependencies = [
        ('customer', '0004_auto_20170413_1853'),
    ]

    operations = [
        migrations.RunPython(forwards_func)
    ]

## Instruction:
Load current User model for customer email migration.
## Code After:
from __future__ import unicode_literals

from django.db import migrations

from oscar.core.compat import get_user_model

User = get_user_model()


def forwards_func(apps, schema_editor):
    for user in User.objects.all():
        user.emails.update(email=user.email)


class Migration(migrations.Migration):

    dependencies = [
        ('customer', '0004_auto_20170413_1853'),
    ]

    operations = [
        migrations.RunPython(forwards_func)
    ]
