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:
@@ -19,7 +19,7 @@ class Migration(migrations.Migration):
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')),
|
||||
('enabled', models.BooleanField(default=False, verbose_name='Enabled')),
|
||||
('base_url', models.TextField(help_text=b'The alternative hostname to serve static assets from. Should be in the form of hostname[:port].', blank=True)),
|
||||
('base_url', models.TextField(help_text=u'The alternative hostname to serve static assets from. Should be in the form of hostname[:port].', blank=True)),
|
||||
('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -20,7 +20,7 @@ class Migration(migrations.Migration):
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')),
|
||||
('enabled', models.BooleanField(default=False, verbose_name='Enabled')),
|
||||
('excluded_extensions', models.TextField(default=b'html', help_text=b'The file extensions to exclude from canonicalization. No leading period required. Values should be space separated i.e. "html svg css"')),
|
||||
('excluded_extensions', models.TextField(default=u'html', help_text=u'The file extensions to exclude from canonicalization. No leading period required. Values should be space separated i.e. "html svg css"')),
|
||||
('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -25,7 +25,7 @@ class AssetBaseUrlConfig(ConfigurationModel):
|
||||
|
||||
base_url = TextField(
|
||||
blank=True,
|
||||
help_text="The alternative hostname to serve static assets from. Should be in the form of hostname[:port]."
|
||||
help_text=u"The alternative hostname to serve static assets from. Should be in the form of hostname[:port]."
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@@ -52,8 +52,8 @@ class AssetExcludedExtensionsConfig(ConfigurationModel):
|
||||
app_label = 'static_replace'
|
||||
|
||||
excluded_extensions = TextField(
|
||||
default='html',
|
||||
help_text='The file extensions to exclude from canonicalization. No leading period required. ' +
|
||||
default=u'html',
|
||||
help_text=u'The file extensions to exclude from canonicalization. No leading period required. ' +
|
||||
'Values should be space separated i.e. "html svg css"'
|
||||
)
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class Migration(migrations.Migration):
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')),
|
||||
('enabled', models.BooleanField(default=False, verbose_name='Enabled')),
|
||||
('disabled_blocks', models.TextField(default=b'', help_text='Space-separated list of XBlocks which should not render.', blank=True)),
|
||||
('disabled_blocks', models.TextField(default=u'', help_text='Space-separated list of XBlocks which should not render.', blank=True)),
|
||||
('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')),
|
||||
],
|
||||
options={
|
||||
|
||||
@@ -14,6 +14,6 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='xblockdisableconfig',
|
||||
name='disabled_create_blocks',
|
||||
field=models.TextField(default=b'', help_text='Space-separated list of XBlock types whose creation to disable in Studio.', blank=True),
|
||||
field=models.TextField(default=u'', help_text='Space-separated list of XBlock types whose creation to disable in Studio.', blank=True),
|
||||
),
|
||||
]
|
||||
|
||||
@@ -36,8 +36,8 @@ class Migration(migrations.Migration):
|
||||
('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')),
|
||||
('enabled', models.BooleanField(default=False, verbose_name='Enabled')),
|
||||
('name', models.CharField(max_length=255, db_index=True)),
|
||||
('template', models.CharField(default=b'', max_length=255, blank=True)),
|
||||
('support_level', models.CharField(default=b'us', max_length=2, choices=[(b'fs', 'Fully Supported'), (b'ps', 'Provisionally Supported'), (b'us', 'Unsupported')])),
|
||||
('template', models.CharField(default=u'', max_length=255, blank=True)),
|
||||
('support_level', models.CharField(default=u'us', max_length=2, choices=[(u'fs', 'Fully Supported'), (u'ps', 'Provisionally Supported'), (u'us', 'Unsupported')])),
|
||||
('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -62,9 +62,9 @@ class XBlockStudioConfiguration(ConfigurationModel):
|
||||
"""
|
||||
KEY_FIELDS = ('name', 'template') # xblock name/template combination is unique
|
||||
|
||||
FULL_SUPPORT = 'fs'
|
||||
PROVISIONAL_SUPPORT = 'ps'
|
||||
UNSUPPORTED = 'us'
|
||||
FULL_SUPPORT = u'fs'
|
||||
PROVISIONAL_SUPPORT = u'ps'
|
||||
UNSUPPORTED = u'us'
|
||||
|
||||
SUPPORT_CHOICES = (
|
||||
(FULL_SUPPORT, _('Fully Supported')),
|
||||
@@ -74,7 +74,7 @@ class XBlockStudioConfiguration(ConfigurationModel):
|
||||
|
||||
# boolean field 'enabled' inherited from parent ConfigurationModel
|
||||
name = models.CharField(max_length=255, null=False, db_index=True)
|
||||
template = models.CharField(max_length=255, blank=True, default='')
|
||||
template = models.CharField(max_length=255, blank=True, default=u'')
|
||||
support_level = models.CharField(max_length=2, choices=SUPPORT_CHOICES, default=UNSUPPORTED)
|
||||
|
||||
class Meta(object):
|
||||
|
||||
@@ -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)),
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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')]),
|
||||
),
|
||||
]
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -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')]),
|
||||
),
|
||||
]
|
||||
|
||||
@@ -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')),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -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)),
|
||||
|
||||
@@ -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()),
|
||||
],
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -14,6 +14,6 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='catalogintegration',
|
||||
name='service_username',
|
||||
field=models.CharField(default=b'lms_catalog_service_user', help_text='Username created for Course Catalog Integration, e.g. lms_catalog_service_user.', max_length=100),
|
||||
field=models.CharField(default=u'lms_catalog_service_user', help_text='Username created for Course Catalog Integration, e.g. lms_catalog_service_user.', max_length=100),
|
||||
),
|
||||
]
|
||||
|
||||
@@ -46,7 +46,7 @@ class CatalogIntegration(ConfigurationModel):
|
||||
|
||||
service_username = models.CharField(
|
||||
max_length=100,
|
||||
default='lms_catalog_service_user',
|
||||
default=u'lms_catalog_service_user',
|
||||
null=False,
|
||||
blank=False,
|
||||
help_text=_(
|
||||
|
||||
@@ -14,6 +14,6 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='courseoverview',
|
||||
name='org',
|
||||
field=models.TextField(default=b'outdated_entry', max_length=255),
|
||||
field=models.TextField(default=u'outdated_entry', max_length=255),
|
||||
),
|
||||
]
|
||||
|
||||
@@ -19,8 +19,8 @@ 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)),
|
||||
('small_url', models.TextField(default=b'', blank=True)),
|
||||
('large_url', models.TextField(default=b'', blank=True)),
|
||||
('small_url', models.TextField(default=u'', blank=True)),
|
||||
('large_url', models.TextField(default=u'', blank=True)),
|
||||
('course_overview', models.OneToOneField(related_name='image_set', to='course_overviews.CourseOverview', on_delete=models.CASCADE)),
|
||||
],
|
||||
options={
|
||||
|
||||
@@ -27,7 +27,7 @@ class Migration(migrations.Migration):
|
||||
('version', models.IntegerField()),
|
||||
('id', opaque_keys.edx.django.models.CourseKeyField(db_index=True, max_length=255)),
|
||||
('_location', opaque_keys.edx.django.models.UsageKeyField(max_length=255)),
|
||||
('org', models.TextField(default=b'outdated_entry', max_length=255)),
|
||||
('org', models.TextField(default=u'outdated_entry', max_length=255)),
|
||||
('display_name', models.TextField(null=True)),
|
||||
('display_number_with_default', models.TextField()),
|
||||
('display_org_with_default', models.TextField()),
|
||||
|
||||
@@ -21,7 +21,7 @@ class Migration(migrations.Migration):
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')),
|
||||
('enabled', models.BooleanField(default=False, verbose_name='Enabled')),
|
||||
('arguments', models.TextField(blank=True, default=b'', help_text=b'Useful for manually running a Jenkins job. Specify like "--delay 10 --listeners A B C --courses X Y Z".')),
|
||||
('arguments', models.TextField(blank=True, default=u'', help_text=u'Useful for manually running a Jenkins job. Specify like "--delay 10 --listeners A B C --courses X Y Z".')),
|
||||
('changed_by', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='Changed by')),
|
||||
],
|
||||
options={
|
||||
|
||||
@@ -15,6 +15,6 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='simulatecoursepublishconfig',
|
||||
name='arguments',
|
||||
field=models.TextField(blank=True, default=b'', help_text=b'Useful for manually running a Jenkins job. Specify like "--delay 10 --receivers A B C --courses X Y Z".'),
|
||||
field=models.TextField(blank=True, default=u'', help_text=u'Useful for manually running a Jenkins job. Specify like "--delay 10 --receivers A B C --courses X Y Z".'),
|
||||
),
|
||||
]
|
||||
|
||||
@@ -61,7 +61,7 @@ class CourseOverview(TimeStampedModel):
|
||||
# Course identification
|
||||
id = CourseKeyField(db_index=True, primary_key=True, max_length=255)
|
||||
_location = UsageKeyField(max_length=255)
|
||||
org = TextField(max_length=255, default='outdated_entry')
|
||||
org = TextField(max_length=255, default=u'outdated_entry')
|
||||
display_name = TextField(null=True)
|
||||
display_number_with_default = TextField()
|
||||
display_org_with_default = TextField()
|
||||
@@ -815,8 +815,8 @@ class CourseOverviewImageSet(TimeStampedModel):
|
||||
"""
|
||||
course_overview = models.OneToOneField(CourseOverview, db_index=True, related_name="image_set",
|
||||
on_delete=models.CASCADE)
|
||||
small_url = models.TextField(blank=True, default="")
|
||||
large_url = models.TextField(blank=True, default="")
|
||||
small_url = models.TextField(blank=True, default=u"")
|
||||
large_url = models.TextField(blank=True, default=u"")
|
||||
|
||||
@classmethod
|
||||
def create(cls, course_overview, course=None):
|
||||
@@ -935,9 +935,9 @@ class SimulateCoursePublishConfig(ConfigurationModel):
|
||||
|
||||
arguments = models.TextField(
|
||||
blank=True,
|
||||
help_text='Useful for manually running a Jenkins job. Specify like "--delay 10 --receivers A B C \
|
||||
help_text=u'Useful for manually running a Jenkins job. Specify like "--delay 10 --receivers A B C \
|
||||
--courses X Y Z".',
|
||||
default='',
|
||||
default=u'',
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
|
||||
Reference in New Issue
Block a user