Skip to content
Snippets Groups Projects
Unverified Commit a384e753 authored by Manjinder Singh's avatar Manjinder Singh Committed by GitHub
Browse files

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

* Fix type mismatches in the course_modes migrations

* Fix type mismatches in the course_action_state migrations

* Fix type mismatches in the schedules migrations

* Fix type mismatches in grades migrations

* Fix type mismatches in video_pipeline

* Fix type mismatches in api_admin

* Fix mismatches in credential migrations
parent dc0a6488
No related branches found
No related tags found
No related merge requests found
Showing
with 52 additions and 52 deletions
......@@ -25,7 +25,7 @@ class Migration(migrations.Migration):
('should_display', models.BooleanField(default=False)),
('message', models.CharField(max_length=1000)),
('source_course_key', CourseKeyField(max_length=255, db_index=True)),
('display_name', models.CharField(default=b'', max_length=255, blank=True)),
('display_name', models.CharField(default=u'', max_length=255, blank=True)),
('created_user', models.ForeignKey(related_name='created_by_user+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True)),
('updated_user', models.ForeignKey(related_name='updated_by_user+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True)),
],
......
......@@ -117,7 +117,7 @@ class CourseRerunState(CourseActionUIState):
source_course_key = CourseKeyField(max_length=255, db_index=True)
# Display name for destination course
display_name = models.CharField(max_length=255, default="", blank=True)
display_name = models.CharField(max_length=255, default=u"", blank=True)
# MANAGERS
# Override the abstract class' manager with a Rerun-specific manager that inherits from the base class' manager.
......
......@@ -19,12 +19,12 @@ class Migration(migrations.Migration):
('mode_slug', models.CharField(max_length=100, verbose_name='Mode')),
('mode_display_name', models.CharField(max_length=255, verbose_name='Display Name')),
('min_price', models.IntegerField(default=0, verbose_name='Price')),
('currency', models.CharField(default=b'usd', max_length=8)),
('currency', models.CharField(default=u'usd', max_length=8)),
('expiration_datetime', models.DateTimeField(default=None, help_text='OPTIONAL: After this date/time, users will no longer be able to enroll in this mode. Leave this blank if users can enroll in this mode until enrollment closes for the course.', null=True, verbose_name='Upgrade Deadline', blank=True)),
('expiration_date', models.DateField(default=None, null=True, blank=True)),
('suggested_prices', models.CommaSeparatedIntegerField(default=b'', max_length=255, blank=True)),
('suggested_prices', models.CommaSeparatedIntegerField(default=u'', max_length=255, blank=True)),
('description', models.TextField(null=True, blank=True)),
('sku', models.CharField(help_text='OPTIONAL: This is the SKU (stock keeping unit) of this mode in the external ecommerce service. Leave this blank if the course has not yet been migrated to the ecommerce service.', max_length=255, null=True, verbose_name=b'SKU', blank=True)),
('sku', models.CharField(help_text='OPTIONAL: This is the SKU (stock keeping unit) of this mode in the external ecommerce service. Leave this blank if the course has not yet been migrated to the ecommerce service.', max_length=255, null=True, verbose_name=u'SKU', blank=True)),
],
),
migrations.CreateModel(
......@@ -35,8 +35,8 @@ class Migration(migrations.Migration):
('mode_slug', models.CharField(max_length=100)),
('mode_display_name', models.CharField(max_length=255)),
('min_price', models.IntegerField(default=0)),
('suggested_prices', models.CommaSeparatedIntegerField(default=b'', max_length=255, blank=True)),
('currency', models.CharField(default=b'usd', max_length=8)),
('suggested_prices', models.CommaSeparatedIntegerField(default=u'', max_length=255, blank=True)),
('currency', models.CharField(default=u'usd', max_length=8)),
('expiration_date', models.DateField(default=None, null=True, blank=True)),
('expiration_datetime', models.DateTimeField(default=None, null=True, blank=True)),
],
......
......@@ -21,7 +21,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='coursemode',
name='_expiration_datetime',
field=models.DateTimeField(db_column=b'expiration_datetime', default=None, blank=True, help_text='OPTIONAL: After this date/time, users will no longer be able to enroll in this mode. Leave this blank if users can enroll in this mode until enrollment closes for the course.', null=True, verbose_name='Upgrade Deadline'),
field=models.DateTimeField(db_column=u'expiration_datetime', default=None, blank=True, help_text='OPTIONAL: After this date/time, users will no longer be able to enroll in this mode. Leave this blank if users can enroll in this mode until enrollment closes for the course.', null=True, verbose_name='Upgrade Deadline'),
),
]
)
......
......@@ -14,6 +14,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='coursemode',
name='bulk_sku',
field=models.CharField(default=None, max_length=255, blank=True, help_text='This is the bulk SKU (stock keeping unit) of this mode in the external ecommerce service.', null=True, verbose_name=b'Bulk SKU'),
field=models.CharField(default=None, max_length=255, blank=True, help_text='This is the bulk SKU (stock keeping unit) of this mode in the external ecommerce service.', null=True, verbose_name=u'Bulk SKU'),
),
]
......@@ -17,6 +17,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='coursemode',
name='suggested_prices',
field=models.CharField(default=b'', max_length=255, blank=True, validators=[django.core.validators.RegexValidator(re.compile('^[\\d,]+\\Z'), 'Enter only digits separated by commas.', 'invalid')]),
field=models.CharField(default=u'', max_length=255, blank=True, validators=[django.core.validators.RegexValidator(re.compile('^[\\d,]+\\Z'), 'Enter only digits separated by commas.', 'invalid')]),
),
]
......@@ -17,6 +17,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='coursemodesarchive',
name='suggested_prices',
field=models.CharField(default=b'', max_length=255, blank=True, validators=[django.core.validators.RegexValidator(re.compile('^[\\d,]+\\Z'), 'Enter only digits separated by commas.', 'invalid')]),
field=models.CharField(default=u'', max_length=255, blank=True, validators=[django.core.validators.RegexValidator(re.compile('^[\\d,]+\\Z'), 'Enter only digits separated by commas.', 'invalid')]),
),
]
......@@ -18,11 +18,11 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='coursemode',
name='suggested_prices',
field=models.CharField(blank=True, default=b'', max_length=255, validators=[django.core.validators.RegexValidator(re.compile('^\d+(?:\,\d+)*\Z'), code='invalid', message='Enter only digits separated by commas.')]),
field=models.CharField(blank=True, default=u'', max_length=255, validators=[django.core.validators.RegexValidator(re.compile('^\d+(?:\,\d+)*\Z'), code='invalid', message='Enter only digits separated by commas.')]),
),
migrations.AlterField(
model_name='coursemodesarchive',
name='suggested_prices',
field=models.CharField(blank=True, default=b'', max_length=255, validators=[django.core.validators.RegexValidator(re.compile('^\d+(?:\,\d+)*\Z'), code='invalid', message='Enter only digits separated by commas.')]),
field=models.CharField(blank=True, default=u'', max_length=255, validators=[django.core.validators.RegexValidator(re.compile('^\d+(?:\,\d+)*\Z'), code='invalid', message='Enter only digits separated by commas.')]),
),
]
......@@ -26,14 +26,14 @@ class Migration(migrations.Migration):
('mode_slug', models.CharField(max_length=100, verbose_name='Mode')),
('mode_display_name', models.CharField(max_length=255, verbose_name='Display Name')),
('min_price', models.IntegerField(default=0, verbose_name='Price')),
('currency', models.CharField(default='usd', max_length=8)),
('_expiration_datetime', models.DateTimeField(blank=True, db_column='expiration_datetime', default=None, help_text='OPTIONAL: After this date/time, users will no longer be able to enroll in this mode. Leave this blank if users can enroll in this mode until enrollment closes for the course.', null=True, verbose_name='Upgrade Deadline')),
('currency', models.CharField(default=u'usd', max_length=8)),
('_expiration_datetime', models.DateTimeField(blank=True, db_column=u'expiration_datetime', default=None, help_text='OPTIONAL: After this date/time, users will no longer be able to enroll in this mode. Leave this blank if users can enroll in this mode until enrollment closes for the course.', null=True, verbose_name='Upgrade Deadline')),
('expiration_datetime_is_explicit', models.BooleanField(default=False)),
('expiration_date', models.DateField(blank=True, default=None, null=True)),
('suggested_prices', models.CharField(blank=True, default='', max_length=255, validators=[django.core.validators.RegexValidator(re.compile('^\\d+(?:\\,\\d+)*\\Z'), code='invalid', message='Enter only digits separated by commas.')])),
('suggested_prices', models.CharField(blank=True, default=u'', max_length=255, validators=[django.core.validators.RegexValidator(re.compile('^\\d+(?:\\,\\d+)*\\Z'), code='invalid', message='Enter only digits separated by commas.')])),
('description', models.TextField(blank=True, null=True)),
('sku', models.CharField(blank=True, help_text='OPTIONAL: This is the SKU (stock keeping unit) of this mode in the external ecommerce service. Leave this blank if the course has not yet been migrated to the ecommerce service.', max_length=255, null=True, verbose_name='SKU')),
('bulk_sku', models.CharField(blank=True, default=None, help_text='This is the bulk SKU (stock keeping unit) of this mode in the external ecommerce service.', max_length=255, null=True, verbose_name='Bulk SKU')),
('sku', models.CharField(blank=True, help_text='OPTIONAL: This is the SKU (stock keeping unit) of this mode in the external ecommerce service. Leave this blank if the course has not yet been migrated to the ecommerce service.', max_length=255, null=True, verbose_name=u'SKU')),
('bulk_sku', models.CharField(blank=True, default=None, help_text='This is the bulk SKU (stock keeping unit) of this mode in the external ecommerce service.', max_length=255, null=True, verbose_name=u'Bulk SKU')),
('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField()),
('history_change_reason', models.CharField(max_length=100, null=True)),
......
......@@ -84,7 +84,7 @@ class CourseMode(models.Model):
min_price = models.IntegerField(default=0, verbose_name=_("Price"))
# the currency these prices are in, using lower case ISO currency codes
currency = models.CharField(default="usd", max_length=8)
currency = models.CharField(default=u"usd", max_length=8)
# The datetime at which the course mode will expire.
# This is used to implement "upgrade" deadlines.
......@@ -98,7 +98,7 @@ class CourseMode(models.Model):
u"OPTIONAL: After this date/time, users will no longer be able to enroll in this mode. "
u"Leave this blank if users can enroll in this mode until enrollment closes for the course."
),
db_column='expiration_datetime',
db_column=u'expiration_datetime',
)
# The system prefers to set this automatically based on default settings. But
......@@ -112,7 +112,7 @@ class CourseMode(models.Model):
# DEPRECATED: the suggested prices for this mode
# We used to allow users to choose from a set of prices, but we now allow only
# a single price. This field has been deprecated by `min_price`
suggested_prices = models.CharField(max_length=255, blank=True, default='',
suggested_prices = models.CharField(max_length=255, blank=True, default=u'',
validators=[validate_comma_separated_integer_list])
# optional description override
......@@ -124,7 +124,7 @@ class CourseMode(models.Model):
max_length=255,
null=True,
blank=True,
verbose_name="SKU",
verbose_name=u"SKU",
help_text=_(
u"OPTIONAL: This is the SKU (stock keeping unit) of this mode in the external ecommerce service. "
u"Leave this blank if the course has not yet been migrated to the ecommerce service."
......@@ -137,7 +137,7 @@ class CourseMode(models.Model):
null=True,
blank=True,
default=None, # Need this in order to set DEFAULT NULL on the database column
verbose_name="Bulk SKU",
verbose_name=u"Bulk SKU",
help_text=_(
u"This is the bulk SKU (stock keeping unit) of this mode in the external ecommerce service."
)
......@@ -892,11 +892,11 @@ class CourseModesArchive(models.Model):
min_price = models.IntegerField(default=0)
# the suggested prices for this mode
suggested_prices = models.CharField(max_length=255, blank=True, default='',
suggested_prices = models.CharField(max_length=255, blank=True, default=u'',
validators=[validate_comma_separated_integer_list])
# the currency these prices are in, using lower case ISO currency codes
currency = models.CharField(default="usd", max_length=8)
currency = models.CharField(default=u"usd", max_length=8)
# turn this mode off after the given expiration date
expiration_date = models.DateField(default=None, null=True, blank=True)
......
......@@ -94,5 +94,5 @@ class ComputeGradesSetting(ConfigurationModel):
batch_size = IntegerField(default=100)
course_ids = TextField(
blank=False,
help_text="Whitespace-separated list of course keys for which to compute grades."
help_text=u"Whitespace-separated list of course keys for which to compute grades."
)
......@@ -13,6 +13,6 @@ class ScoreDatabaseTableEnum(object):
class GradeOverrideFeatureEnum(object):
proctoring = 'PROCTORING'
gradebook = 'GRADEBOOK'
proctoring = u'PROCTORING'
gradebook = u'GRADEBOOK'
grade_import = 'grade-import'
......@@ -21,7 +21,7 @@ class Migration(migrations.Migration):
('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')),
('enabled', models.BooleanField(default=False, verbose_name='Enabled')),
('batch_size', models.IntegerField(default=100)),
('course_ids', models.TextField(help_text=b'Whitespace-separated list of course keys for which to compute grades.')),
('course_ids', models.TextField(help_text=u'Whitespace-separated list of course keys for which to compute grades.')),
('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,8 +20,8 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('override_id', models.IntegerField(db_index=True)),
('feature', models.CharField(choices=[(b'PROCTORING', b'proctoring'), (b'GRADEBOOK', b'gradebook')], default=b'PROCTORING', max_length=32)),
('action', models.CharField(choices=[(b'CREATEORUPDATE', b'create_or_update'), (b'DELETE', b'delete')], default=b'CREATEORUPDATE', max_length=32)),
('feature', models.CharField(choices=[(u'PROCTORING', u'proctoring'), (u'GRADEBOOK', u'gradebook')], default=u'PROCTORING', max_length=32)),
('action', models.CharField(choices=[(u'CREATEORUPDATE', u'create_or_update'), (u'DELETE', u'delete')], default=u'CREATEORUPDATE', max_length=32)),
('comments', models.CharField(blank=True, max_length=300, null=True)),
('created', models.DateTimeField(auto_now_add=True, db_index=True)),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
......
......@@ -781,15 +781,15 @@ class PersistentSubsectionGradeOverrideHistory(models.Model):
.. no_pii:
"""
OVERRIDE_FEATURES = (
(constants.GradeOverrideFeatureEnum.proctoring, 'proctoring'),
(constants.GradeOverrideFeatureEnum.gradebook, 'gradebook'),
(constants.GradeOverrideFeatureEnum.proctoring, u'proctoring'),
(constants.GradeOverrideFeatureEnum.gradebook, u'gradebook'),
)
CREATE_OR_UPDATE = 'CREATEORUPDATE'
DELETE = 'DELETE'
CREATE_OR_UPDATE = u'CREATEORUPDATE'
DELETE = u'DELETE'
OVERRIDE_ACTIONS = (
(CREATE_OR_UPDATE, 'create_or_update'),
(DELETE, 'delete')
(CREATE_OR_UPDATE, u'create_or_update'),
(DELETE, u'delete')
)
class Meta(object):
......
......@@ -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)),
('status', models.CharField(default=b'pending', help_text='Status of this API access request', max_length=255, db_index=True, choices=[(b'pending', 'Pending'), (b'denied', 'Denied'), (b'approved', 'Approved')])),
('status', models.CharField(default=u'pending', help_text='Status of this API access request', max_length=255, db_index=True, choices=[(u'pending', 'Pending'), (u'denied', 'Denied'), (u'approved', 'Approved')])),
('website', models.URLField(help_text='The URL of the website associated with this API user.')),
('reason', models.TextField(help_text='The reason this user wants to access the API.')),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
......@@ -38,7 +38,7 @@ class Migration(migrations.Migration):
('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=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)),
('status', models.CharField(default=b'pending', help_text='Status of this API access request', max_length=255, db_index=True, choices=[(b'pending', 'Pending'), (b'denied', 'Denied'), (b'approved', 'Approved')])),
('status', models.CharField(default=u'pending', help_text='Status of this API access request', max_length=255, db_index=True, choices=[(u'pending', 'Pending'), (u'denied', 'Denied'), (u'approved', 'Approved')])),
('website', models.URLField(help_text='The URL of the website associated with this API user.')),
('reason', models.TextField(help_text='The reason this user wants to access the API.')),
('history_id', models.AutoField(serialize=False, primary_key=True)),
......
......@@ -30,22 +30,22 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='apiaccessrequest',
name='company_address',
field=models.CharField(default=b'', max_length=255),
field=models.CharField(default=u'', max_length=255),
),
migrations.AddField(
model_name='apiaccessrequest',
name='company_name',
field=models.CharField(default=b'', max_length=255),
field=models.CharField(default=u'', max_length=255),
),
migrations.AddField(
model_name='historicalapiaccessrequest',
name='company_address',
field=models.CharField(default=b'', max_length=255),
field=models.CharField(default=u'', max_length=255),
),
migrations.AddField(
model_name='historicalapiaccessrequest',
name='company_name',
field=models.CharField(default=b'', max_length=255),
field=models.CharField(default=u'', max_length=255),
),
migrations.AlterField(
model_name='apiaccessrequest',
......
......@@ -36,9 +36,9 @@ class ApiAccessRequest(TimeStampedModel):
.. pii_retirement: local_api
"""
PENDING = 'pending'
DENIED = 'denied'
APPROVED = 'approved'
PENDING = u'pending'
DENIED = u'denied'
APPROVED = u'approved'
STATUS_CHOICES = (
(PENDING, _('Pending')),
(DENIED, _('Denied')),
......@@ -54,8 +54,8 @@ class ApiAccessRequest(TimeStampedModel):
)
website = models.URLField(help_text=_('The URL of the website associated with this API user.'))
reason = models.TextField(help_text=_('The reason this user wants to access the API.'))
company_name = models.CharField(max_length=255, default='')
company_address = models.CharField(max_length=255, default='')
company_name = models.CharField(max_length=255, default=u'')
company_address = models.CharField(max_length=255, default=u'')
site = models.ForeignKey(Site, on_delete=models.CASCADE)
contacted = models.BooleanField(default=False)
......
......@@ -14,11 +14,11 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='credentialsapiconfig',
name='internal_service_url',
field=models.URLField(help_text=b'DEPRECATED: Use the setting CREDENTIALS_INTERNAL_SERVICE_URL.', verbose_name='Internal Service URL'),
field=models.URLField(help_text=u'DEPRECATED: Use the setting CREDENTIALS_INTERNAL_SERVICE_URL.', verbose_name='Internal Service URL'),
),
migrations.AlterField(
model_name='credentialsapiconfig',
name='public_service_url',
field=models.URLField(help_text=b'DEPRECATED: Use the setting CREDENTIALS_PUBLIC_SERVICE_URL.', verbose_name='Public Service URL'),
field=models.URLField(help_text=u'DEPRECATED: Use the setting CREDENTIALS_PUBLIC_SERVICE_URL.', verbose_name='Public Service URL'),
),
]
......@@ -35,11 +35,11 @@ class CredentialsApiConfig(ConfigurationModel):
internal_service_url = models.URLField(
verbose_name=_('Internal Service URL'),
help_text='DEPRECATED: Use the setting CREDENTIALS_INTERNAL_SERVICE_URL.'
help_text=u'DEPRECATED: Use the setting CREDENTIALS_INTERNAL_SERVICE_URL.'
)
public_service_url = models.URLField(
verbose_name=_('Public Service URL'),
help_text='DEPRECATED: Use the setting CREDENTIALS_PUBLIC_SERVICE_URL.'
help_text=u'DEPRECATED: Use the setting CREDENTIALS_PUBLIC_SERVICE_URL.'
)
enable_learner_issuance = models.BooleanField(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment