Merge pull request #28294 from edx/python2_unicode_rm_common
chore: Django3 has removed python_2_unicode_compatible.
This commit is contained in:
@@ -16,7 +16,7 @@ from django.core.exceptions import ValidationError
|
||||
from django.db import models, transaction
|
||||
from django.db.models import Count
|
||||
from django.dispatch import receiver
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from model_utils import Choices
|
||||
from model_utils.fields import AutoCreatedField
|
||||
@@ -438,7 +438,6 @@ class GeneratedCertificate(models.Model):
|
||||
)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class CertificateGenerationHistory(TimeStampedModel):
|
||||
"""
|
||||
Model for storing Certificate Generation History.
|
||||
@@ -503,7 +502,6 @@ class CertificateGenerationHistory(TimeStampedModel):
|
||||
("regenerated" if self.is_regeneration else "generated", self.generated_by, self.created, self.course_id)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class CertificateInvalidation(TimeStampedModel):
|
||||
"""
|
||||
Model for storing Certificate Invalidation.
|
||||
@@ -1014,7 +1012,6 @@ class CertificateHtmlViewConfiguration(ConfigurationModel):
|
||||
return json_data
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class CertificateTemplate(TimeStampedModel):
|
||||
"""A set of custom web certificate templates.
|
||||
|
||||
@@ -1095,7 +1092,6 @@ def template_assets_path(instance, filename):
|
||||
return name
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class CertificateTemplateAsset(TimeStampedModel):
|
||||
"""A set of assets to be used in custom web certificate templates.
|
||||
|
||||
|
||||
@@ -5,11 +5,10 @@ Commerce-related models.
|
||||
|
||||
from config_models.models import ConfigurationModel
|
||||
from django.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class CommerceConfiguration(ConfigurationModel):
|
||||
"""
|
||||
Commerce configuration
|
||||
|
||||
@@ -7,13 +7,12 @@ controlling persistent grades.
|
||||
from config_models.models import ConfigurationModel
|
||||
from django.conf import settings
|
||||
from django.db.models import BooleanField, IntegerField, TextField
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from opaque_keys.edx.django.models import CourseKeyField
|
||||
|
||||
from openedx.core.lib.cache_utils import request_cached
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class PersistentGradesEnabledFlag(ConfigurationModel):
|
||||
"""
|
||||
Enables persistent grades across the platform.
|
||||
@@ -71,7 +70,6 @@ class PersistentGradesEnabledFlag(ConfigurationModel):
|
||||
)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class CoursePersistentGradesFlag(ConfigurationModel):
|
||||
"""
|
||||
Enables persistent grades for a specific
|
||||
|
||||
@@ -3,8 +3,6 @@ Code used to get and cache the requested course-data
|
||||
"""
|
||||
|
||||
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from lms.djangoapps.course_blocks.api import get_course_blocks
|
||||
from openedx.core.djangoapps.content.block_structure.api import get_block_structure_manager
|
||||
from xmodule.modulestore.django import modulestore
|
||||
@@ -12,7 +10,6 @@ from xmodule.modulestore.django import modulestore
|
||||
from .transformer import GradesTransformer
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class CourseData:
|
||||
"""
|
||||
Utility access layer to intelligently get and cache the
|
||||
|
||||
@@ -17,7 +17,7 @@ from hashlib import sha1
|
||||
|
||||
from django.apps import apps
|
||||
from django.db import models, IntegrityError, transaction
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from django.utils.timezone import now
|
||||
from lazy import lazy
|
||||
from model_utils.models import TimeStampedModel
|
||||
@@ -125,7 +125,6 @@ class BlockRecordList:
|
||||
return cls(blocks, course_key)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class VisibleBlocks(models.Model):
|
||||
"""
|
||||
A django model used to track the state of a set of visible blocks under a
|
||||
@@ -290,7 +289,6 @@ class VisibleBlocks(models.Model):
|
||||
return f"visible_blocks_cache.{course_key}.{user_id}"
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class PersistentSubsectionGrade(TimeStampedModel):
|
||||
"""
|
||||
A django model tracking persistent grades at the subsection level.
|
||||
@@ -533,7 +531,6 @@ class PersistentSubsectionGrade(TimeStampedModel):
|
||||
return f"subsection_grades_cache.{course_id}"
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class PersistentCourseGrade(TimeStampedModel):
|
||||
"""
|
||||
A django model tracking persistent course grades.
|
||||
@@ -670,7 +667,6 @@ class PersistentCourseGrade(TimeStampedModel):
|
||||
events.course_grade_calculated(grade)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class PersistentSubsectionGradeOverride(models.Model):
|
||||
"""
|
||||
A django model tracking persistent grades overrides at the subsection level.
|
||||
|
||||
@@ -24,7 +24,7 @@ from django.conf import settings
|
||||
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
|
||||
from django.core.files.base import ContentFile
|
||||
from django.db import models, transaction
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from django.utils.translation import ugettext as _
|
||||
from opaque_keys.edx.django.models import CourseKeyField
|
||||
|
||||
@@ -38,7 +38,6 @@ PROGRESS = 'PROGRESS'
|
||||
TASK_INPUT_LENGTH = 10000
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class InstructorTask(models.Model):
|
||||
"""
|
||||
Stores information about background tasks that have been submitted to
|
||||
|
||||
Reference in New Issue
Block a user