BOM-981,983,984

Fixing migrations.
This commit is contained in:
Awais Qureshi
2019-10-24 11:49:58 +05:00
parent 28a48fe6a6
commit 82fb16b2f7
6 changed files with 25 additions and 25 deletions

View File

@@ -29,7 +29,7 @@ class Migration(migrations.Migration):
name='CountryAccessRule',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('rule_type', models.CharField(default=b'blacklist', help_text='Whether to include or exclude the given course. If whitelist countries are specified, then ONLY users from whitelisted countries will be able to access the course. If blacklist countries are specified, then users from blacklisted countries will NOT be able to access the course.', max_length=255, choices=[(b'whitelist', b'Whitelist (allow only these countries)'), (b'blacklist', b'Blacklist (block these countries)')])),
('rule_type', models.CharField(default=u'blacklist', help_text='Whether to include or exclude the given course. If whitelist countries are specified, then ONLY users from whitelisted countries will be able to access the course. If blacklist countries are specified, then users from blacklisted countries will NOT be able to access the course.', max_length=255, choices=[(u'whitelist', u'Whitelist (allow only these countries)'), (u'blacklist', u'Blacklist (block these countries)')])),
('country', models.ForeignKey(help_text='The country to which this rule applies.', to='embargo.Country', on_delete=models.CASCADE)),
],
),
@@ -59,7 +59,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')),
('embargoed_countries', models.TextField(help_text=b'A comma-separated list of country codes that fall under U.S. embargo restrictions', blank=True)),
('embargoed_countries', models.TextField(help_text=u'A comma-separated list of country codes that fall under U.S. embargo restrictions', 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={
@@ -73,8 +73,8 @@ 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')),
('whitelist', models.TextField(help_text=b'A comma-separated list of IP addresses that should not fall under embargo restrictions.', blank=True)),
('blacklist', models.TextField(help_text=b'A comma-separated list of IP addresses that should fall under embargo restrictions.', blank=True)),
('whitelist', models.TextField(help_text=u'A comma-separated list of IP addresses that should not fall under embargo restrictions.', blank=True)),
('blacklist', models.TextField(help_text=u'A comma-separated list of IP addresses that should fall under embargo restrictions.', 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={
@@ -87,8 +87,8 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_key', CourseKeyField(help_text='The course key for the restricted course.', unique=True, max_length=255, db_index=True)),
('enroll_msg_key', models.CharField(default=b'default', help_text='The message to show when a user is blocked from enrollment.', max_length=255, choices=[(b'default', b'Default'), (b'embargo', b'Embargo')])),
('access_msg_key', models.CharField(default=b'default', help_text='The message to show when a user is blocked from accessing a course.', max_length=255, choices=[(b'default', b'Default'), (b'embargo', b'Embargo')])),
('enroll_msg_key', models.CharField(default=u'default', help_text=u'The message to show when a user is blocked from enrollment.', max_length=255, choices=[(u'default', u'Default'), (u'embargo', u'Embargo')])),
('access_msg_key', models.CharField(default=u'default', help_text=u'The message to show when a user is blocked from accessing a course.', max_length=255, choices=[(u'default', u'Default'), (u'embargo', u'Embargo')])),
('disable_access_check', models.BooleanField(default=False, help_text='Allow users who enrolled in an allowed country to access restricted courses from excluded countries.')),
],
),

View File

@@ -88,7 +88,7 @@ class EmbargoedState(ConfigurationModel):
# The countries to embargo
embargoed_countries = models.TextField(
blank=True,
help_text="A comma-separated list of country codes that fall under U.S. embargo restrictions"
help_text=u"A comma-separated list of country codes that fall under U.S. embargo restrictions"
)
@property
@@ -127,15 +127,15 @@ class RestrictedCourse(models.Model):
COURSE_LIST_CACHE_KEY = 'embargo.restricted_courses'
MESSAGE_URL_CACHE_KEY = 'embargo.message_url_path.{access_point}.{course_key}'
ENROLL_MSG_KEY_CHOICES = tuple([
ENROLL_MSG_KEY_CHOICES = tuple(sorted([
(msg_key, msg.description)
for msg_key, msg in six.iteritems(ENROLL_MESSAGES)
])
]))
COURSEWARE_MSG_KEY_CHOICES = tuple([
COURSEWARE_MSG_KEY_CHOICES = tuple(sorted([
(msg_key, msg.description)
for msg_key, msg in six.iteritems(COURSEWARE_MESSAGES)
])
]))
course_key = CourseKeyField(
max_length=255, db_index=True, unique=True,
@@ -145,14 +145,14 @@ class RestrictedCourse(models.Model):
enroll_msg_key = models.CharField(
max_length=255,
choices=ENROLL_MSG_KEY_CHOICES,
default='default',
default=u'default',
help_text=ugettext_lazy(u"The message to show when a user is blocked from enrollment.")
)
access_msg_key = models.CharField(
max_length=255,
choices=COURSEWARE_MSG_KEY_CHOICES,
default='default',
default=u'default',
help_text=ugettext_lazy(u"The message to show when a user is blocked from accessing a course.")
)
@@ -422,12 +422,12 @@ class CountryAccessRule(models.Model):
.. no_pii:
"""
WHITELIST_RULE = 'whitelist'
BLACKLIST_RULE = 'blacklist'
WHITELIST_RULE = u'whitelist'
BLACKLIST_RULE = u'blacklist'
RULE_TYPE_CHOICES = (
(WHITELIST_RULE, 'Whitelist (allow only these countries)'),
(BLACKLIST_RULE, 'Blacklist (block these countries)'),
(WHITELIST_RULE, u'Whitelist (allow only these countries)'),
(BLACKLIST_RULE, u'Blacklist (block these countries)'),
)
rule_type = models.CharField(
@@ -694,12 +694,12 @@ class IPFilter(ConfigurationModel):
"""
whitelist = models.TextField(
blank=True,
help_text="A comma-separated list of IP addresses that should not fall under embargo restrictions."
help_text=u"A comma-separated list of IP addresses that should not fall under embargo restrictions."
)
blacklist = models.TextField(
blank=True,
help_text="A comma-separated list of IP addresses that should fall under embargo restrictions."
help_text=u"A comma-separated list of IP addresses that should fall under embargo restrictions."
)
class IPFilterList(object):

View File

@@ -14,11 +14,11 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='siteconfiguration',
name='enabled',
field=models.BooleanField(default=False, verbose_name=b'Enabled'),
field=models.BooleanField(default=False, verbose_name=u'Enabled'),
),
migrations.AddField(
model_name='siteconfigurationhistory',
name='enabled',
field=models.BooleanField(default=False, verbose_name=b'Enabled'),
field=models.BooleanField(default=False, verbose_name=u'Enabled'),
),
]

View File

@@ -30,7 +30,7 @@ class SiteConfiguration(models.Model):
.. no_pii:
"""
site = models.OneToOneField(Site, related_name='configuration', on_delete=models.CASCADE)
enabled = models.BooleanField(default=False, verbose_name="Enabled")
enabled = models.BooleanField(default=False, verbose_name=u"Enabled")
values = JSONField(
null=False,
blank=True,
@@ -151,7 +151,7 @@ class SiteConfigurationHistory(TimeStampedModel):
.. no_pii:
"""
site = models.ForeignKey(Site, related_name='configuration_histories', on_delete=models.CASCADE)
enabled = models.BooleanField(default=False, verbose_name="Enabled")
enabled = models.BooleanField(default=False, verbose_name=u"Enabled")
values = JSONField(
null=False,
blank=True,

View File

@@ -14,7 +14,7 @@ class Migration(migrations.Migration):
name='Announcement',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('content', models.CharField(default=b'lorem ipsum', max_length=1000)),
('content', models.CharField(default=u'lorem ipsum', max_length=1000)),
('active', models.BooleanField(default=True)),
],
),

View File

@@ -14,7 +14,7 @@ class Announcement(models.Model):
class Meta(object):
app_label = 'announcements'
content = models.CharField(max_length=1000, null=False, default="lorem ipsum")
content = models.CharField(max_length=1000, null=False, default=u"lorem ipsum")
active = models.BooleanField(default=True)
def __str__(self):