Fixing migrations.
This commit is contained in:
Awais Qureshi
2019-10-24 14:22:35 +05:00
parent 28a48fe6a6
commit 6abaf893f1
9 changed files with 36 additions and 36 deletions

View File

@@ -26,7 +26,7 @@ class Migration(migrations.Migration):
('uuid', models.UUIDField(default=uuid.uuid4, editable=False)),
('course_uuid', models.UUIDField()),
('expired_at', models.DateTimeField(null=True)),
('mode', models.CharField(default=b'audit', max_length=100)),
('mode', models.CharField(default=u'audit', max_length=100)),
('order_number', models.CharField(max_length=128, null=True)),
('enrollment_course_run', models.ForeignKey(to='student.CourseEnrollment', null=True, on_delete=models.CASCADE)),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),

View File

@@ -17,21 +17,21 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='courseentitlement',
name='course_uuid',
field=models.UUIDField(help_text=b'UUID for the Course, not the Course Run'),
field=models.UUIDField(help_text=u'UUID for the Course, not the Course Run'),
),
migrations.AlterField(
model_name='courseentitlement',
name='enrollment_course_run',
field=models.ForeignKey(to='student.CourseEnrollment', help_text=b'The current Course enrollment for this entitlement. If NULL the Learner has not enrolled.', null=True, on_delete=models.CASCADE),
field=models.ForeignKey(to='student.CourseEnrollment', help_text=u'The current Course enrollment for this entitlement. If NULL the Learner has not enrolled.', null=True, on_delete=models.CASCADE),
),
migrations.AlterField(
model_name='courseentitlement',
name='expired_at',
field=models.DateTimeField(help_text=b'The date that an entitlement expired, if NULL the entitlement has not expired.', null=True),
field=models.DateTimeField(help_text=u'The date that an entitlement expired, if NULL the entitlement has not expired.', null=True),
),
migrations.AlterField(
model_name='courseentitlement',
name='mode',
field=models.CharField(help_text=b'The mode of the Course that will be applied on enroll.', max_length=100),
field=models.CharField(help_text=u'The mode of the Course that will be applied on enroll.', max_length=100),
),
]

View File

@@ -18,21 +18,21 @@ class Migration(migrations.Migration):
name='CourseEntitlementPolicy',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('expiration_period', models.DurationField(default=datetime.timedelta(450), help_text=b'Duration in days from when an entitlement is created until when it is expired.')),
('refund_period', models.DurationField(default=datetime.timedelta(60), help_text=b'Duration in days from when an entitlement is created until when it is no longer refundable')),
('regain_period', models.DurationField(default=datetime.timedelta(14), help_text=b'Duration in days from when an entitlement is redeemed for a course run until it is no longer able to be regained by a user.')),
('expiration_period', models.DurationField(default=datetime.timedelta(450), help_text=u'Duration in days from when an entitlement is created until when it is expired.')),
('refund_period', models.DurationField(default=datetime.timedelta(60), help_text=u'Duration in days from when an entitlement is created until when it is no longer refundable')),
('regain_period', models.DurationField(default=datetime.timedelta(14), help_text=u'Duration in days from when an entitlement is redeemed for a course run until it is no longer able to be regained by a user.')),
('site', models.ForeignKey(to='sites.Site', on_delete=models.CASCADE)),
],
),
migrations.AlterField(
model_name='courseentitlement',
name='enrollment_course_run',
field=models.ForeignKey(blank=True, to='student.CourseEnrollment', help_text=b'The current Course enrollment for this entitlement. If NULL the Learner has not enrolled.', null=True, on_delete=models.CASCADE),
field=models.ForeignKey(blank=True, to='student.CourseEnrollment', help_text=u'The current Course enrollment for this entitlement. If NULL the Learner has not enrolled.', null=True, on_delete=models.CASCADE),
),
migrations.AlterField(
model_name='courseentitlement',
name='expired_at',
field=models.DateTimeField(help_text=b'The date that an entitlement expired, if NULL the entitlement has not expired.', null=True, blank=True),
field=models.DateTimeField(help_text=u'The date that an entitlement expired, if NULL the entitlement has not expired.', null=True, blank=True),
),
migrations.AddField(
model_name='courseentitlement',

View File

@@ -22,7 +22,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)),
('reason', models.CharField(max_length=15, choices=[(b'LEAVE', 'Learner requested leave session for expired entitlement'), (b'CHANGE', 'Learner requested session change for expired entitlement'), (b'LEARNER_NEW', 'Learner requested new entitlement'), (b'COURSE_TEAM_NEW', 'Course team requested entitlement for learnerg'), (b'OTHER', 'Other')])),
('reason', models.CharField(max_length=15, choices=[(u'LEAVE', 'Learner requested leave session for expired entitlement'), (u'CHANGE', 'Learner requested session change for expired entitlement'), (u'LEARNER_NEW', 'Learner requested new entitlement'), (u'COURSE_TEAM_NEW', 'Course team requested entitlement for learnerg'), (u'OTHER', 'Other')])),
('comments', models.TextField(null=True)),
('entitlement', models.ForeignKey(to='entitlements.CourseEntitlement', on_delete=models.CASCADE)),
('support_user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),

View File

@@ -14,7 +14,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='courseentitlementsupportdetail',
name='action',
field=models.CharField(default='CREATE', max_length=15, choices=[(b'REISSUE', b'Re-issue entitlement'), (b'CREATE', b'Create new entitlement')]),
field=models.CharField(default='CREATE', max_length=15, choices=[(u'REISSUE', u'Re-issue entitlement'), (u'CREATE', u'Create new entitlement')]),
preserve_default=False,
),
]

View File

@@ -16,6 +16,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='courseentitlementpolicy',
name='expiration_period',
field=models.DurationField(default=datetime.timedelta(730), help_text=b'Duration in days from when an entitlement is created until when it is expired.'),
field=models.DurationField(default=datetime.timedelta(730), help_text=u'Duration in days from when an entitlement is created until when it is expired.'),
),
]

View File

@@ -14,7 +14,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='courseentitlementpolicy',
name='mode',
field=models.CharField(max_length=32, null=True, choices=[(None, b'---------'), (b'verified', b'verified'), (b'professional', b'professional')]),
field=models.CharField(max_length=32, null=True, choices=[(None, u'---------'), (u'verified', u'verified'), (u'professional', u'professional')]),
),
migrations.AlterField(
model_name='courseentitlementpolicy',

View File

@@ -27,9 +27,9 @@ class Migration(migrations.Migration):
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
('uuid', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False)),
('course_uuid', models.UUIDField(help_text=b'UUID for the Course, not the Course Run')),
('expired_at', models.DateTimeField(blank=True, help_text=b'The date that an entitlement expired, if NULL the entitlement has not expired.', null=True)),
('mode', models.CharField(help_text=b'The mode of the Course that will be applied on enroll.', max_length=100)),
('course_uuid', models.UUIDField(help_text=u'UUID for the Course, not the Course Run')),
('expired_at', models.DateTimeField(blank=True, help_text=u'The date that an entitlement expired, if NULL the entitlement has not expired.', null=True)),
('mode', models.CharField(help_text=u'The mode of the Course that will be applied on enroll.', max_length=100)),
('order_number', models.CharField(max_length=128, null=True)),
('refund_locked', models.BooleanField(default=False)),
('history_id', models.AutoField(primary_key=True, serialize=False)),
@@ -37,7 +37,7 @@ class Migration(migrations.Migration):
('history_change_reason', models.CharField(max_length=100, null=True)),
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
('_policy', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='entitlements.CourseEntitlementPolicy')),
('enrollment_course_run', models.ForeignKey(blank=True, db_constraint=False, help_text=b'The current Course enrollment for this entitlement. If NULL the Learner has not enrolled.', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='student.CourseEnrollment')),
('enrollment_course_run', models.ForeignKey(blank=True, db_constraint=False, help_text=u'The current Course enrollment for this entitlement. If NULL the Learner has not enrolled.', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='student.CourseEnrollment')),
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
('user', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)),
],

View File

@@ -38,23 +38,23 @@ class CourseEntitlementPolicy(models.Model):
DEFAULT_EXPIRATION_PERIOD_DAYS = 730
DEFAULT_REFUND_PERIOD_DAYS = 60
DEFAULT_REGAIN_PERIOD_DAYS = 14
MODES = Choices((None, '---------'), CourseMode.VERIFIED, CourseMode.PROFESSIONAL)
MODES = Choices((None, u'---------'), CourseMode.VERIFIED, CourseMode.PROFESSIONAL)
# Use a DurationField to calculate time as it returns a timedelta, useful in performing operations with datetimes
expiration_period = models.DurationField(
default=timedelta(days=DEFAULT_EXPIRATION_PERIOD_DAYS),
help_text="Duration in days from when an entitlement is created until when it is expired.",
help_text=u"Duration in days from when an entitlement is created until when it is expired.",
null=False
)
refund_period = models.DurationField(
default=timedelta(days=DEFAULT_REFUND_PERIOD_DAYS),
help_text="Duration in days from when an entitlement is created until when it is no longer refundable",
help_text=u"Duration in days from when an entitlement is created until when it is no longer refundable",
null=False
)
regain_period = models.DurationField(
default=timedelta(days=DEFAULT_REGAIN_PERIOD_DAYS),
help_text=("Duration in days from when an entitlement is redeemed for a course run until "
"it is no longer able to be regained by a user."),
help_text=(u"Duration in days from when an entitlement is redeemed for a course run until "
u"it is no longer able to be regained by a user."),
null=False
)
site = models.ForeignKey(Site, null=True, on_delete=models.CASCADE)
@@ -158,17 +158,17 @@ class CourseEntitlement(TimeStampedModel):
"""
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
uuid = models.UUIDField(default=uuid_tools.uuid4, editable=False, unique=True)
course_uuid = models.UUIDField(help_text='UUID for the Course, not the Course Run')
course_uuid = models.UUIDField(help_text=u'UUID for the Course, not the Course Run')
expired_at = models.DateTimeField(
null=True,
help_text='The date that an entitlement expired, if NULL the entitlement has not expired.',
help_text=u'The date that an entitlement expired, if NULL the entitlement has not expired.',
blank=True
)
mode = models.CharField(max_length=100, help_text='The mode of the Course that will be applied on enroll.')
mode = models.CharField(max_length=100, help_text=u'The mode of the Course that will be applied on enroll.')
enrollment_course_run = models.ForeignKey(
'student.CourseEnrollment',
null=True,
help_text='The current Course enrollment for this entitlement. If NULL the Learner has not enrolled.',
help_text=u'The current Course enrollment for this entitlement. If NULL the Learner has not enrolled.',
blank=True,
on_delete=models.CASCADE,
)
@@ -458,11 +458,11 @@ class CourseEntitlementSupportDetail(TimeStampedModel):
.. no_pii:
"""
# Reasons deprecated
LEAVE_SESSION = 'LEAVE'
CHANGE_SESSION = 'CHANGE'
LEARNER_REQUEST_NEW = 'LEARNER_NEW'
COURSE_TEAM_REQUEST_NEW = 'COURSE_TEAM_NEW'
OTHER = 'OTHER'
LEAVE_SESSION = u'LEAVE'
CHANGE_SESSION = u'CHANGE'
LEARNER_REQUEST_NEW = u'LEARNER_NEW'
COURSE_TEAM_REQUEST_NEW = u'COURSE_TEAM_NEW'
OTHER = u'OTHER'
ENTITLEMENT_SUPPORT_REASONS = (
(LEAVE_SESSION, u'Learner requested leave session for expired entitlement'),
(CHANGE_SESSION, u'Learner requested session change for expired entitlement'),
@@ -471,11 +471,11 @@ class CourseEntitlementSupportDetail(TimeStampedModel):
(OTHER, u'Other'),
)
REISSUE = 'REISSUE'
CREATE = 'CREATE'
REISSUE = u'REISSUE'
CREATE = u'CREATE'
ENTITLEMENT_SUPPORT_ACTIONS = (
(REISSUE, 'Re-issue entitlement'),
(CREATE, 'Create new entitlement'),
(REISSUE, u'Re-issue entitlement'),
(CREATE, u'Create new entitlement'),
)
entitlement = models.ForeignKey('entitlements.CourseEntitlement', on_delete=models.CASCADE)