From fe8a0c6f00c833ed76334a8ea59769dfcb9df8e5 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Thu, 15 Jul 2021 12:09:50 +0500 Subject: [PATCH] Django3 has removed python_2_unicode_compatible. Execute the codemodes on this file and removed all usage. --- common/djangoapps/student/models.py | 4 ++++ lms/djangoapps/badges/models.py | 2 ++ lms/djangoapps/bulk_email/models.py | 2 ++ 3 files changed, 8 insertions(+) diff --git a/common/djangoapps/student/models.py b/common/djangoapps/student/models.py index 7d23d033df..2a3a678dd7 100644 --- a/common/djangoapps/student/models.py +++ b/common/djangoapps/student/models.py @@ -972,6 +972,8 @@ class PendingSecondaryEmailChange(DeletableByUserValue, models.Model): EVENT_NAME_ENROLLMENT_ACTIVATED = 'edx.course.enrollment.activated' EVENT_NAME_ENROLLMENT_DEACTIVATED = 'edx.course.enrollment.deactivated' EVENT_NAME_ENROLLMENT_MODE_CHANGED = 'edx.course.enrollment.mode_changed' + + class LoginFailures(models.Model): """ This model will keep track of failed login attempts. @@ -1198,6 +1200,8 @@ class CourseEnrollmentManager(models.Manager): # CourseEnrollment for a user in a course. This type # is used to cache the state in the request cache. CourseEnrollmentState = namedtuple('CourseEnrollmentState', 'mode, is_active') + + class CourseEnrollment(models.Model): """ Represents a Student's Enrollment record for a single Course. You should diff --git a/lms/djangoapps/badges/models.py b/lms/djangoapps/badges/models.py index c0c94d00d0..3a4c700f5b 100644 --- a/lms/djangoapps/badges/models.py +++ b/lms/djangoapps/badges/models.py @@ -180,6 +180,8 @@ class BadgeAssertion(TimeStampedModel): # Abstract model doesn't index this, so we have to. BadgeAssertion._meta.get_field('created').db_index = True + + class CourseCompleteImageConfiguration(models.Model): """ Contains the icon configuration for badges for a specific course mode. diff --git a/lms/djangoapps/bulk_email/models.py b/lms/djangoapps/bulk_email/models.py index 42b118469d..283417252d 100644 --- a/lms/djangoapps/bulk_email/models.py +++ b/lms/djangoapps/bulk_email/models.py @@ -56,6 +56,8 @@ EMAIL_TARGET_CHOICES = list(zip( ['Myself', 'Staff and instructors', 'All students', 'Specific cohort', 'Specific course mode'] )) EMAIL_TARGETS = {target[0] for target in EMAIL_TARGET_CHOICES} + + class Target(models.Model): """ A way to refer to a particular group (within a course) as a "Send to:" target.