Repository: jazzband/django-axes

Issue:
Migrations in Python3
In the old migrations some fields were prefixed with b'
In a Python3 environment this resulted into:

```
You have unapplied migrations; your app may not work properly until they are applied.
Run 'python manage.py migrate' to apply them.
```

Because Python3 wants to remove those b' prefixes.
I changed it in my fork, however, I suspect that on a Python2.x environment you'll get the same error message if you would use my Py3 fork with a Django version lower than 1.7

https://code.djangoproject.com/ticket/22564



Discussion:

Resolving patch:
diff --git a/axes/migrations/0001_initial.py b/axes/migrations/0001_initial.py
--- a/axes/migrations/0001_initial.py
+++ b/axes/migrations/0001_initial.py
@@ -15,15 +15,15 @@ class Migration(migrations.Migration):
             fields=[
                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                 ('user_agent', models.CharField(max_length=255)),
-                ('ip_address', models.GenericIPAddressField(null=True, verbose_name=b'IP Address')),
+                ('ip_address', models.GenericIPAddressField(null=True, verbose_name='IP Address')),
                 ('username', models.CharField(max_length=255, null=True)),
                 ('trusted', models.BooleanField(default=False)),
-                ('http_accept', models.CharField(max_length=1025, verbose_name=b'HTTP Accept')),
-                ('path_info', models.CharField(max_length=255, verbose_name=b'Path')),
+                ('http_accept', models.CharField(max_length=1025, verbose_name='HTTP Accept')),
+                ('path_info', models.CharField(max_length=255, verbose_name='Path')),
                 ('attempt_time', models.DateTimeField(auto_now_add=True)),
-                ('get_data', models.TextField(verbose_name=b'GET Data')),
-                ('post_data', models.TextField(verbose_name=b'POST Data')),
-                ('failures_since_start', models.PositiveIntegerField(verbose_name=b'Failed Logins')),
+                ('get_data', models.TextField(verbose_name='GET Data')),
+                ('post_data', models.TextField(verbose_name='POST Data')),
+                ('failures_since_start', models.PositiveIntegerField(verbose_name='Failed Logins')),
             ],
             options={
                 'ordering': ['-attempt_time'],
@@ -35,11 +35,11 @@ class Migration(migrations.Migration):
             fields=[
                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                 ('user_agent', models.CharField(max_length=255)),
-                ('ip_address', models.GenericIPAddressField(null=True, verbose_name=b'IP Address')),
+                ('ip_address', models.GenericIPAddressField(null=True, verbose_name='IP Address')),
                 ('username', models.CharField(max_length=255, null=True)),
                 ('trusted', models.BooleanField(default=False)),
-                ('http_accept', models.CharField(max_length=1025, verbose_name=b'HTTP Accept')),
-                ('path_info', models.CharField(max_length=255, verbose_name=b'Path')),
+                ('http_accept', models.CharField(max_length=1025, verbose_name='HTTP Accept')),
+                ('path_info', models.CharField(max_length=255, verbose_name='Path')),
                 ('attempt_time', models.DateTimeField(auto_now_add=True)),
                 ('logout_time', models.DateTimeField(null=True, blank=True)),
             ],
diff --git a/axes/migrations/0002_auto_20151217_2044.py b/axes/migrations/0002_auto_20151217_2044.py
--- a/axes/migrations/0002_auto_20151217_2044.py
+++ b/axes/migrations/0002_auto_20151217_2044.py
@@ -14,7 +14,7 @@ class Migration(migrations.Migration):
         migrations.AlterField(
             model_name='accessattempt',
             name='ip_address',
-            field=models.GenericIPAddressField(db_index=True, null=True, verbose_name=b'IP Address'),
+            field=models.GenericIPAddressField(db_index=True, null=True, verbose_name='IP Address'),
         ),
         migrations.AlterField(
             model_name='accessattempt',
@@ -34,7 +34,7 @@ class Migration(migrations.Migration):
         migrations.AlterField(
             model_name='accesslog',
             name='ip_address',
-            field=models.GenericIPAddressField(db_index=True, null=True, verbose_name=b'IP Address'),
+            field=models.GenericIPAddressField(db_index=True, null=True, verbose_name='IP Address'),
         ),
         migrations.AlterField(
             model_name='accesslog',


Test patch: