BOM-933: Fix type mismatches in various migrations 4 (#22146)

* fix type mismatch in course_goals  migrations

* fix type mismatch in experiments  migrations

* fix type mismatch in xblock_django  migrations

* fix type mismatch in catalog  migrations

* fix type mismatch in static_replace  migrations

* fix type mismatch in bulk_email  migrations

* fix type mismatch in course_overviews migrations
This commit is contained in:
Manjinder Singh
2019-10-24 13:47:51 -04:00
committed by GitHub
parent 05e9e56d56
commit 7f3045cf75
25 changed files with 47 additions and 47 deletions

View File

@@ -32,7 +32,7 @@ class Migration(migrations.Migration):
('created', models.DateTimeField(auto_now_add=True)),
('modified', models.DateTimeField(auto_now=True)),
('course_id', CourseKeyField(max_length=255, db_index=True)),
('to_option', models.CharField(default=b'myself', max_length=64, choices=[(b'myself', b'Myself'), (b'staff', b'Staff and instructors'), (b'all', b'All')])),
('to_option', models.CharField(default=u'myself', max_length=64, choices=[(u'myself', u'Myself'), (u'staff', u'Staff and instructors'), (u'all', u'All')])),
('template_name', models.CharField(max_length=255, null=True)),
('from_addr', models.CharField(max_length=255, null=True)),
('sender', models.ForeignKey(default=1, blank=True, to=settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE)),

View File

@@ -16,13 +16,13 @@ class Migration(migrations.Migration):
name='Target',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('target_type', models.CharField(max_length=64, choices=[(b'myself', b'Myself'), (b'staff', b'Staff and instructors'), (b'learners', b'All students'), (b'cohort', b'Specific cohort')])),
('target_type', models.CharField(max_length=64, choices=[(u'myself', u'Myself'), (u'staff', u'Staff and instructors'), (u'learners', u'All students'), (u'cohort', u'Specific cohort')])),
],
),
migrations.AlterField(
model_name='courseemail',
name='to_option',
field=models.CharField(max_length=64, choices=[(b'deprecated', b'deprecated')]),
field=models.CharField(max_length=64, choices=[(u'deprecated', u'deprecated')]),
),
migrations.CreateModel(
name='CohortTarget',

View File

@@ -23,6 +23,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='target',
name='target_type',
field=models.CharField(max_length=64, choices=[(b'myself', b'Myself'), (b'staff', b'Staff and instructors'), (b'learners', b'All students'), (b'cohort', b'Specific cohort'), (b'track', b'Specific course mode')]),
field=models.CharField(max_length=64, choices=[(u'myself', u'Myself'), (u'staff', u'Staff and instructors'), (u'learners', u'All students'), (u'cohort', u'Specific cohort'), (u'track', u'Specific course mode')]),
),
]

View File

@@ -49,14 +49,14 @@ class Email(models.Model):
# Bulk email targets - the send to options that users can select from when they send email.
SEND_TO_MYSELF = 'myself'
SEND_TO_STAFF = 'staff'
SEND_TO_LEARNERS = 'learners'
SEND_TO_COHORT = 'cohort'
SEND_TO_TRACK = 'track'
SEND_TO_MYSELF = u'myself'
SEND_TO_STAFF = u'staff'
SEND_TO_LEARNERS = u'learners'
SEND_TO_COHORT = u'cohort'
SEND_TO_TRACK = u'track'
EMAIL_TARGET_CHOICES = list(zip(
[SEND_TO_MYSELF, SEND_TO_STAFF, SEND_TO_LEARNERS, SEND_TO_COHORT, SEND_TO_TRACK],
['Myself', 'Staff and instructors', 'All students', 'Specific cohort', 'Specific course mode']
[u'Myself', u'Staff and instructors', u'All students', u'Specific cohort', u'Specific course mode']
))
EMAIL_TARGETS = {target[0] for target in EMAIL_TARGET_CHOICES}
@@ -251,7 +251,7 @@ class CourseEmail(Email):
course_id = CourseKeyField(max_length=255, db_index=True)
# to_option is deprecated and unused, but dropping db columns is hard so it's still here for legacy reasons
to_option = models.CharField(max_length=64, choices=[("deprecated", "deprecated")])
to_option = models.CharField(max_length=64, choices=[(u"deprecated", u"deprecated")])
targets = models.ManyToManyField(Target)
template_name = models.CharField(null=True, max_length=255)
from_addr = models.CharField(null=True, max_length=255)

View File

@@ -19,7 +19,7 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_key', CourseKeyField(max_length=255, db_index=True)),
('goal_key', models.CharField(default=b'unsure', max_length=100, choices=[(b'certify', 'Earn a certificate.'), (b'complete', 'Complete the course.'), (b'explore', 'Explore the course.'), (b'unsure', 'Not sure yet.')])),
('goal_key', models.CharField(default=u'unsure', max_length=100, choices=[(u'certify', 'Earn a certificate.'), (u'complete', 'Complete the course.'), (u'explore', 'Explore the course.'), (u'unsure', 'Not sure yet.')])),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
],
),

View File

@@ -15,6 +15,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='coursegoal',
name='goal_key',
field=models.CharField(default=b'unsure', max_length=100, choices=[(b'certify', 'Earn a certificate'), (b'complete', 'Complete the course'), (b'explore', 'Explore the course'), (b'unsure', 'Not sure yet')]),
field=models.CharField(default=u'unsure', max_length=100, choices=[(u'certify', 'Earn a certificate'), (u'complete', 'Complete the course'), (u'explore', 'Explore the course'), (u'unsure', 'Not sure yet')]),
),
]

View File

@@ -12,10 +12,10 @@ from opaque_keys.edx.django.models import CourseKeyField
# Each goal is represented by a goal key and a string description.
GOAL_KEY_CHOICES = Choices(
('certify', _('Earn a certificate')),
('complete', _('Complete the course')),
('explore', _('Explore the course')),
('unsure', _('Not sure yet')),
(u'certify', _('Earn a certificate')),
(u'complete', _('Complete the course')),
(u'explore', _('Explore the course')),
(u'unsure', _('Not sure yet')),
)

View File

@@ -21,7 +21,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)),
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
('experiment_id', models.PositiveSmallIntegerField(verbose_name=b'Experiment ID', db_index=True)),
('experiment_id', models.PositiveSmallIntegerField(verbose_name=u'Experiment ID', db_index=True)),
('key', models.CharField(max_length=255)),
('value', models.TextField()),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),

View File

@@ -20,7 +20,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)),
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
('experiment_id', models.PositiveSmallIntegerField(verbose_name=b'Experiment ID', db_index=True)),
('experiment_id', models.PositiveSmallIntegerField(verbose_name=u'Experiment ID', db_index=True)),
('key', models.CharField(max_length=255)),
('value', models.TextField()),
],

View File

@@ -16,7 +16,7 @@ class ExperimentData(TimeStampedModel):
"""
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
experiment_id = models.PositiveSmallIntegerField(
null=False, blank=False, db_index=True, verbose_name='Experiment ID'
null=False, blank=False, db_index=True, verbose_name=u'Experiment ID'
)
key = models.CharField(null=False, blank=False, max_length=255)
value = models.TextField()
@@ -39,7 +39,7 @@ class ExperimentKeyValue(TimeStampedModel):
.. no_pii:
"""
experiment_id = models.PositiveSmallIntegerField(
null=False, blank=False, db_index=True, verbose_name='Experiment ID'
null=False, blank=False, db_index=True, verbose_name=u'Experiment ID'
)
key = models.CharField(null=False, blank=False, max_length=255)
value = models.TextField()