diff --git a/lms/djangoapps/instructor_task/subtasks.py b/lms/djangoapps/instructor_task/subtasks.py index ff9f53c763..db0d2380ea 100644 --- a/lms/djangoapps/instructor_task/subtasks.py +++ b/lms/djangoapps/instructor_task/subtasks.py @@ -14,7 +14,7 @@ import psutil from celery.states import READY_STATES, RETRY, SUCCESS from django.core.cache import cache from django.db import DatabaseError, transaction -from django.utils.encoding import python_2_unicode_compatible + from common.djangoapps.util.db import outer_atomic @@ -120,7 +120,6 @@ def _generate_items_for_subtask( TASK_LOG.info("Number of items generated by chunking %s not equal to original total %s", num_items_queued, total_num_items) # lint-amnesty, pylint: disable=line-too-long -@python_2_unicode_compatible class SubtaskStatus: """ Create and return a dict for tracking the status of a subtask. diff --git a/lms/djangoapps/mobile_api/models.py b/lms/djangoapps/mobile_api/models.py index 777f9cd511..d9e640e03c 100644 --- a/lms/djangoapps/mobile_api/models.py +++ b/lms/djangoapps/mobile_api/models.py @@ -5,7 +5,7 @@ ConfigurationModel for the mobile_api djangoapp. from config_models.models import ConfigurationModel from django.db import models -from django.utils.encoding import python_2_unicode_compatible + from . import utils from .mobile_platform import PLATFORM_CLASSES @@ -36,7 +36,6 @@ class MobileApiConfig(ConfigurationModel): return [profile.strip() for profile in cls.current().video_profiles.split(",") if profile] -@python_2_unicode_compatible class AppVersionConfig(models.Model): """ Configuration for mobile app versions available. diff --git a/lms/djangoapps/rss_proxy/models.py b/lms/djangoapps/rss_proxy/models.py index de44f1ae4e..afa653f6d7 100644 --- a/lms/djangoapps/rss_proxy/models.py +++ b/lms/djangoapps/rss_proxy/models.py @@ -2,11 +2,10 @@ Models for the rss_proxy djangoapp. """ from django.db import models -from django.utils.encoding import python_2_unicode_compatible + from model_utils.models import TimeStampedModel -@python_2_unicode_compatible class WhitelistedRssUrl(TimeStampedModel): """ Model for persisting RSS feed URLs which are whitelisted diff --git a/lms/djangoapps/survey/models.py b/lms/djangoapps/survey/models.py index 1f234fcf33..fdc02e1065 100644 --- a/lms/djangoapps/survey/models.py +++ b/lms/djangoapps/survey/models.py @@ -8,7 +8,7 @@ from collections import OrderedDict from django.core.exceptions import ValidationError from django.db import models -from django.utils.encoding import python_2_unicode_compatible + from lxml import etree from model_utils.models import TimeStampedModel from opaque_keys.edx.django.models import CourseKeyField @@ -20,7 +20,6 @@ from openedx.core.djangolib.markup import HTML log = logging.getLogger("edx.survey") -@python_2_unicode_compatible class SurveyForm(TimeStampedModel): """ Model to define a Survey Form that contains the HTML form data diff --git a/lms/djangoapps/teams/models.py b/lms/djangoapps/teams/models.py index 7eb6c64de7..de76a5d30f 100644 --- a/lms/djangoapps/teams/models.py +++ b/lms/djangoapps/teams/models.py @@ -11,7 +11,7 @@ from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imp from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.dispatch import receiver -from django.utils.encoding import python_2_unicode_compatible + from django.utils.text import slugify from django.utils.translation import ugettext_lazy from django_countries.fields import CountryField @@ -104,7 +104,6 @@ def utc_now(): return datetime.utcnow().replace(tzinfo=pytz.utc) -@python_2_unicode_compatible class CourseTeam(models.Model): """ This model represents team related info. @@ -224,7 +223,6 @@ class CourseTeam(models.Model): self.save() -@python_2_unicode_compatible class CourseTeamMembership(models.Model): """ This model represents the membership of a single user in a single team. diff --git a/lms/djangoapps/verify_student/models.py b/lms/djangoapps/verify_student/models.py index 5d50699e35..02a865d4f0 100644 --- a/lms/djangoapps/verify_student/models.py +++ b/lms/djangoapps/verify_student/models.py @@ -25,7 +25,7 @@ from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imp from django.core.files.base import ContentFile from django.db import models, transaction from django.urls import reverse -from django.utils.encoding import python_2_unicode_compatible + from django.utils.functional import cached_property from django.utils.timezone import now from django.utils.translation import ugettext_lazy @@ -158,7 +158,6 @@ class IDVerificationAttempt(StatusModel): ) -@python_2_unicode_compatible class ManualVerification(IDVerificationAttempt): """ Each ManualVerification represents a user's verification that bypasses the need for @@ -193,7 +192,6 @@ class ManualVerification(IDVerificationAttempt): return False -@python_2_unicode_compatible class SSOVerification(IDVerificationAttempt): """ Each SSOVerification represents a Student's attempt to establish their identity