chore: Django3 has removed python_2_unicode_compatible.

Execute the codemodes.
This commit is contained in:
Awais Qureshi
2021-07-30 22:13:13 +05:00
parent 61b9a523e7
commit eb0a66c2bd
6 changed files with 6 additions and 14 deletions

View File

@@ -14,7 +14,7 @@ import psutil
from celery.states import READY_STATES, RETRY, SUCCESS from celery.states import READY_STATES, RETRY, SUCCESS
from django.core.cache import cache from django.core.cache import cache
from django.db import DatabaseError, transaction from django.db import DatabaseError, transaction
from django.utils.encoding import python_2_unicode_compatible
from common.djangoapps.util.db import outer_atomic 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 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: class SubtaskStatus:
""" """
Create and return a dict for tracking the status of a subtask. Create and return a dict for tracking the status of a subtask.

View File

@@ -5,7 +5,7 @@ ConfigurationModel for the mobile_api djangoapp.
from config_models.models import ConfigurationModel from config_models.models import ConfigurationModel
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from . import utils from . import utils
from .mobile_platform import PLATFORM_CLASSES 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] return [profile.strip() for profile in cls.current().video_profiles.split(",") if profile]
@python_2_unicode_compatible
class AppVersionConfig(models.Model): class AppVersionConfig(models.Model):
""" """
Configuration for mobile app versions available. Configuration for mobile app versions available.

View File

@@ -2,11 +2,10 @@
Models for the rss_proxy djangoapp. Models for the rss_proxy djangoapp.
""" """
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from model_utils.models import TimeStampedModel from model_utils.models import TimeStampedModel
@python_2_unicode_compatible
class WhitelistedRssUrl(TimeStampedModel): class WhitelistedRssUrl(TimeStampedModel):
""" """
Model for persisting RSS feed URLs which are whitelisted Model for persisting RSS feed URLs which are whitelisted

View File

@@ -8,7 +8,7 @@ from collections import OrderedDict
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from lxml import etree from lxml import etree
from model_utils.models import TimeStampedModel from model_utils.models import TimeStampedModel
from opaque_keys.edx.django.models import CourseKeyField from opaque_keys.edx.django.models import CourseKeyField
@@ -20,7 +20,6 @@ from openedx.core.djangolib.markup import HTML
log = logging.getLogger("edx.survey") log = logging.getLogger("edx.survey")
@python_2_unicode_compatible
class SurveyForm(TimeStampedModel): class SurveyForm(TimeStampedModel):
""" """
Model to define a Survey Form that contains the HTML form data Model to define a Survey Form that contains the HTML form data

View File

@@ -11,7 +11,7 @@ from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imp
from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ObjectDoesNotExist
from django.db import models from django.db import models
from django.dispatch import receiver from django.dispatch import receiver
from django.utils.encoding import python_2_unicode_compatible
from django.utils.text import slugify from django.utils.text import slugify
from django.utils.translation import ugettext_lazy from django.utils.translation import ugettext_lazy
from django_countries.fields import CountryField from django_countries.fields import CountryField
@@ -104,7 +104,6 @@ def utc_now():
return datetime.utcnow().replace(tzinfo=pytz.utc) return datetime.utcnow().replace(tzinfo=pytz.utc)
@python_2_unicode_compatible
class CourseTeam(models.Model): class CourseTeam(models.Model):
""" """
This model represents team related info. This model represents team related info.
@@ -224,7 +223,6 @@ class CourseTeam(models.Model):
self.save() self.save()
@python_2_unicode_compatible
class CourseTeamMembership(models.Model): class CourseTeamMembership(models.Model):
""" """
This model represents the membership of a single user in a single team. This model represents the membership of a single user in a single team.

View File

@@ -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.core.files.base import ContentFile
from django.db import models, transaction from django.db import models, transaction
from django.urls import reverse from django.urls import reverse
from django.utils.encoding import python_2_unicode_compatible
from django.utils.functional import cached_property from django.utils.functional import cached_property
from django.utils.timezone import now from django.utils.timezone import now
from django.utils.translation import ugettext_lazy from django.utils.translation import ugettext_lazy
@@ -158,7 +158,6 @@ class IDVerificationAttempt(StatusModel):
) )
@python_2_unicode_compatible
class ManualVerification(IDVerificationAttempt): class ManualVerification(IDVerificationAttempt):
""" """
Each ManualVerification represents a user's verification that bypasses the need for Each ManualVerification represents a user's verification that bypasses the need for
@@ -193,7 +192,6 @@ class ManualVerification(IDVerificationAttempt):
return False return False
@python_2_unicode_compatible
class SSOVerification(IDVerificationAttempt): class SSOVerification(IDVerificationAttempt):
""" """
Each SSOVerification represents a Student's attempt to establish their identity Each SSOVerification represents a Student's attempt to establish their identity