from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('djstripe', '0022_fix_subscriber_delete'),
    ]

    operations = [
        migrations.AlterField(
            model_name='customer',
            name='subscriber',
            field=models.ForeignKey(null=True, on_delete=models.SET_NULL, related_name='djstripe_customers', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterUniqueTogether(
            name='customer',
            unique_together=set([('subscriber', 'livemode')]),
        ),
    ]

from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models


DJSTRIPE_SUBSCRIBER_MODEL = getattr(settings, "DJSTRIPE_SUBSCRIBER_MODEL", settings.AUTH_USER_MODEL)


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('djstripe', '0022_fix_subscriber_delete'),
    ]

    operations = [
        migrations.AlterField(
            model_name='customer',
            name='subscriber',
            field=models.ForeignKey(null=True, on_delete=models.SET_NULL, related_name='djstripe_customers', to=DJSTRIPE_SUBSCRIBER_MODEL),
        ),
        migrations.AlterUniqueTogether(
            name='customer',
            unique_together=set([('subscriber', 'livemode')]),
        ),
    ]

Fix migration 0023 subscriber model reference
Fix migration 0023 subscriber model reference

  from __future__ import unicode_literals
  
  from django.conf import settings
  from django.db import migrations, models
+ 
+ 
+ DJSTRIPE_SUBSCRIBER_MODEL = getattr(settings, "DJSTRIPE_SUBSCRIBER_MODEL", settings.AUTH_USER_MODEL)
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          migrations.swappable_dependency(settings.AUTH_USER_MODEL),
          ('djstripe', '0022_fix_subscriber_delete'),
      ]
  
      operations = [
          migrations.AlterField(
              model_name='customer',
              name='subscriber',
-             field=models.ForeignKey(null=True, on_delete=models.SET_NULL, related_name='djstripe_customers', to=settings.AUTH_USER_MODEL),
+             field=models.ForeignKey(null=True, on_delete=models.SET_NULL, related_name='djstripe_customers', to=DJSTRIPE_SUBSCRIBER_MODEL),
          ),
          migrations.AlterUniqueTogether(
              name='customer',
              unique_together=set([('subscriber', 'livemode')]),
          ),
      ]
  
Fix migration 0023 subscriber model reference
## Code Before:
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('djstripe', '0022_fix_subscriber_delete'),
    ]

    operations = [
        migrations.AlterField(
            model_name='customer',
            name='subscriber',
            field=models.ForeignKey(null=True, on_delete=models.SET_NULL, related_name='djstripe_customers', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterUniqueTogether(
            name='customer',
            unique_together=set([('subscriber', 'livemode')]),
        ),
    ]

## Instruction:
Fix migration 0023 subscriber model reference
## Code After:
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models


DJSTRIPE_SUBSCRIBER_MODEL = getattr(settings, "DJSTRIPE_SUBSCRIBER_MODEL", settings.AUTH_USER_MODEL)


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('djstripe', '0022_fix_subscriber_delete'),
    ]

    operations = [
        migrations.AlterField(
            model_name='customer',
            name='subscriber',
            field=models.ForeignKey(null=True, on_delete=models.SET_NULL, related_name='djstripe_customers', to=DJSTRIPE_SUBSCRIBER_MODEL),
        ),
        migrations.AlterUniqueTogether(
            name='customer',
            unique_together=set([('subscriber', 'livemode')]),
        ),
    ]
