From 0fc55690677eb3161ad00a4fd880cd8d66768b09 Mon Sep 17 00:00:00 2001 From: Will Barton Date: Tue, 17 Dec 2019 09:06:08 -0500 Subject: [PATCH] Fix string types in migrations for Python 3 This change removes the leading `b` from strings in the migrations. Python 3 differentiates between strings and bytes, and this causes `makemigrations` to make new migrations to convert all the `b''` strings in the migrations to regular strings. This change avoids creating those superfluous migrations. --- retirement_api/migrations/0001_initial.py | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/retirement_api/migrations/0001_initial.py b/retirement_api/migrations/0001_initial.py index f017a7a..0d6a026 100644 --- a/retirement_api/migrations/0001_initial.py +++ b/retirement_api/migrations/0001_initial.py @@ -49,19 +49,19 @@ class Migration(migrations.Migration): ('title', models.CharField(max_length=500)), ('slug', models.SlugField(blank=True)), ('question', models.TextField(blank=True)), - ('answer_yes_a_subhed', models.CharField(help_text=b'Under 50', max_length=255, blank=True)), - ('answer_yes_a', models.TextField(help_text=b'Under 50', blank=True)), - ('answer_yes_b_subhed', models.CharField(help_text=b'50 and older', max_length=255, blank=True)), - ('answer_yes_b', models.TextField(help_text=b'50 and older', blank=True)), - ('answer_no_a_subhed', models.CharField(help_text=b'Under 50', max_length=255, blank=True)), - ('answer_no_a', models.TextField(help_text=b'Under 50', blank=True)), - ('answer_no_b_subhed', models.CharField(help_text=b'50 and older', max_length=255, blank=True)), - ('answer_no_b', models.TextField(help_text=b'50 and older', blank=True)), - ('answer_unsure_a_subhed', models.CharField(help_text=b'Under 50', max_length=255, blank=True)), - ('answer_unsure_a', models.TextField(help_text=b'Under 50', blank=True)), - ('answer_unsure_b_subhed', models.CharField(help_text=b'50 and older', max_length=255, blank=True)), - ('answer_unsure_b', models.TextField(help_text=b'50 and older', blank=True)), - ('workflow_state', models.CharField(default=b'SUBMITTED', max_length=255, choices=[(b'APPROVED', b'Approved'), (b'REVISED', b'Revised'), (b'SUBMITTED', b'Submitted')])), + ('answer_yes_a_subhed', models.CharField(help_text='Under 50', max_length=255, blank=True)), + ('answer_yes_a', models.TextField(help_text='Under 50', blank=True)), + ('answer_yes_b_subhed', models.CharField(help_text='50 and older', max_length=255, blank=True)), + ('answer_yes_b', models.TextField(help_text='50 and older', blank=True)), + ('answer_no_a_subhed', models.CharField(help_text='Under 50', max_length=255, blank=True)), + ('answer_no_a', models.TextField(help_text='Under 50', blank=True)), + ('answer_no_b_subhed', models.CharField(help_text='50 and older', max_length=255, blank=True)), + ('answer_no_b', models.TextField(help_text='50 and older', blank=True)), + ('answer_unsure_a_subhed', models.CharField(help_text='Under 50', max_length=255, blank=True)), + ('answer_unsure_a', models.TextField(help_text='Under 50', blank=True)), + ('answer_unsure_b_subhed', models.CharField(help_text='50 and older', max_length=255, blank=True)), + ('answer_unsure_b', models.TextField(help_text='50 and older', blank=True)), + ('workflow_state', models.CharField(default='SUBMITTED', max_length=255, choices=[('APPROVED', 'Approved'), ('REVISED', 'Revised'), ('SUBMITTED', 'Submitted')])), ], ), migrations.CreateModel(