from __future__ import unicode_literals

import django.contrib.auth.validators
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('users', '0013_profile_event_reminder_time'),
    ]

    operations = [
        migrations.AlterField(
            model_name='user',
            name='username',
            field=models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.ASCIIUsernameValidator()], verbose_name='username'),
        ),
    ]

from __future__ import unicode_literals

from django.db import migrations, models
try:
    import django.contrib.auth.validators
    extra_kwargs = {'validators': [django.contrib.auth.validators.ASCIIUsernameValidator()]}
except ImportError:
    extra_kwargs = {}


class Migration(migrations.Migration):

    dependencies = [
        ('users', '0013_profile_event_reminder_time'),
    ]

    operations = [
        migrations.AlterField(
            model_name='user',
            name='username',
            field=models.CharField(error_messages={'unique': 'A user with that username already exists.'},
                                   help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                                   max_length=150, unique=True, verbose_name='username', **extra_kwargs),
        ),
    ]

Fix backward compatibility of migrations
Fix backward compatibility of migrations

  from __future__ import unicode_literals
  
- import django.contrib.auth.validators
  from django.db import migrations, models
+ try:
+     import django.contrib.auth.validators
+     extra_kwargs = {'validators': [django.contrib.auth.validators.ASCIIUsernameValidator()]}
+ except ImportError:
+     extra_kwargs = {}
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('users', '0013_profile_event_reminder_time'),
      ]
  
      operations = [
          migrations.AlterField(
              model_name='user',
              name='username',
-             field=models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.ASCIIUsernameValidator()], verbose_name='username'),
+             field=models.CharField(error_messages={'unique': 'A user with that username already exists.'},
+                                    help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
+                                    max_length=150, unique=True, verbose_name='username', **extra_kwargs),
          ),
      ]
  
Fix backward compatibility of migrations
## Code Before:
from __future__ import unicode_literals

import django.contrib.auth.validators
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('users', '0013_profile_event_reminder_time'),
    ]

    operations = [
        migrations.AlterField(
            model_name='user',
            name='username',
            field=models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.ASCIIUsernameValidator()], verbose_name='username'),
        ),
    ]

## Instruction:
Fix backward compatibility of migrations
## Code After:
from __future__ import unicode_literals

from django.db import migrations, models
try:
    import django.contrib.auth.validators
    extra_kwargs = {'validators': [django.contrib.auth.validators.ASCIIUsernameValidator()]}
except ImportError:
    extra_kwargs = {}


class Migration(migrations.Migration):

    dependencies = [
        ('users', '0013_profile_event_reminder_time'),
    ]

    operations = [
        migrations.AlterField(
            model_name='user',
            name='username',
            field=models.CharField(error_messages={'unique': 'A user with that username already exists.'},
                                   help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                                   max_length=150, unique=True, verbose_name='username', **extra_kwargs),
        ),
    ]
