diff --git a/openedx/core/djangoapps/content/course_overviews/signals.py b/openedx/core/djangoapps/content/course_overviews/signals.py index 336724002a36..1f691c238385 100644 --- a/openedx/core/djangoapps/content/course_overviews/signals.py +++ b/openedx/core/djangoapps/content/course_overviews/signals.py @@ -15,9 +15,10 @@ LOG = logging.getLogger(__name__) - -COURSE_START_DATE_CHANGED = Signal(providing_args=["updated_course_overview", "previous_start_date"]) -COURSE_PACING_CHANGED = Signal(providing_args=["updated_course_overview", "previous_self_paced"]) +# providing_args=["updated_course_overview", "previous_start_date"] +COURSE_START_DATE_CHANGED = Signal() +# providing_args=["updated_course_overview", "previous_self_paced"] +COURSE_PACING_CHANGED = Signal() @receiver(SignalHandler.course_published) diff --git a/openedx/core/djangoapps/content/learning_sequences/apps.py b/openedx/core/djangoapps/content/learning_sequences/apps.py index 5c2fbd1704b3..46b9bb45b3f4 100644 --- a/openedx/core/djangoapps/content/learning_sequences/apps.py +++ b/openedx/core/djangoapps/content/learning_sequences/apps.py @@ -1,7 +1,7 @@ # lint-amnesty, pylint: disable=missing-module-docstring from django.apps import AppConfig from django.conf import settings -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from edx_proctoring.runtime import set_runtime_service diff --git a/openedx/core/djangoapps/content_libraries/api.py b/openedx/core/djangoapps/content_libraries/api.py index 1d5dd4bf3e6c..ce0ac313a2ed 100644 --- a/openedx/core/djangoapps/content_libraries/api.py +++ b/openedx/core/djangoapps/content_libraries/api.py @@ -66,7 +66,7 @@ from django.core.exceptions import PermissionDenied from django.core.validators import validate_unicode_slug from django.db import IntegrityError -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from elasticsearch.exceptions import ConnectionError as ElasticConnectionError from lxml import etree from opaque_keys.edx.keys import LearningContextKey, UsageKey diff --git a/openedx/core/djangoapps/content_libraries/constants.py b/openedx/core/djangoapps/content_libraries/constants.py index 0ae985ea2ce3..0a0614e514d9 100644 --- a/openedx/core/djangoapps/content_libraries/constants.py +++ b/openedx/core/djangoapps/content_libraries/constants.py @@ -1,5 +1,5 @@ """ Constants used for the content libraries. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ # ./api.py and ./views.py are only used in Studio, so we always work with this draft of any # content library bundle: diff --git a/openedx/core/djangoapps/content_libraries/models.py b/openedx/core/djangoapps/content_libraries/models.py index 25b5500e1f82..32e2103e0d00 100644 --- a/openedx/core/djangoapps/content_libraries/models.py +++ b/openedx/core/djangoapps/content_libraries/models.py @@ -42,7 +42,7 @@ from django.core.exceptions import ValidationError from django.db import models from django.db import transaction -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from opaque_keys.edx.django.models import CourseKeyField from opaque_keys.edx.locator import LibraryLocatorV2 diff --git a/openedx/core/djangoapps/content_libraries/signals.py b/openedx/core/djangoapps/content_libraries/signals.py index 90b3228fe2d2..c6fd16497a98 100644 --- a/openedx/core/djangoapps/content_libraries/signals.py +++ b/openedx/core/djangoapps/content_libraries/signals.py @@ -4,9 +4,14 @@ from django.dispatch import Signal -CONTENT_LIBRARY_CREATED = Signal(providing_args=['library_key']) -CONTENT_LIBRARY_UPDATED = Signal(providing_args=['library_key', 'update_blocks']) -CONTENT_LIBRARY_DELETED = Signal(providing_args=['library_key']) -LIBRARY_BLOCK_CREATED = Signal(providing_args=['library_key', 'usage_key']) -LIBRARY_BLOCK_DELETED = Signal(providing_args=['library_key', 'usage_key']) -LIBRARY_BLOCK_UPDATED = Signal(providing_args=['library_key', 'usage_key']) +# providing_args=['library_key'] +CONTENT_LIBRARY_CREATED = Signal() +# providing_args=['library_key', 'update_blocks'] +CONTENT_LIBRARY_UPDATED = Signal() +# providing_args=['library_key'] +CONTENT_LIBRARY_DELETED = Signal() + +# Same providing_args=['library_key', 'usage_key'] for next 3 signals. +LIBRARY_BLOCK_CREATED = Signal() +LIBRARY_BLOCK_DELETED = Signal() +LIBRARY_BLOCK_UPDATED = Signal() diff --git a/openedx/core/djangoapps/discussions/plugins.py b/openedx/core/djangoapps/discussions/plugins.py index 74d8c843aa5f..f48c31d12b78 100644 --- a/openedx/core/djangoapps/discussions/plugins.py +++ b/openedx/core/djangoapps/discussions/plugins.py @@ -5,7 +5,7 @@ from django.conf import settings from django.contrib.auth import get_user_model -from django.utils.translation import ugettext_noop as _ +from django.utils.translation import gettext_noop as _ from opaque_keys.edx.keys import CourseKey from openedx.core.djangoapps.course_apps.plugins import CourseApp diff --git a/openedx/core/djangoapps/django_comment_common/models.py b/openedx/core/djangoapps/django_comment_common/models.py index 8c6542063d6a..dcb2bc35bd54 100644 --- a/openedx/core/djangoapps/django_comment_common/models.py +++ b/openedx/core/djangoapps/django_comment_common/models.py @@ -11,7 +11,7 @@ from django.db.models.signals import post_save from django.dispatch import receiver -from django.utils.translation import ugettext_noop +from django.utils.translation import gettext_noop from jsonfield.fields import JSONField from opaque_keys.edx.django.models import CourseKeyField @@ -22,11 +22,11 @@ from xmodule.modulestore.django import modulestore from xmodule.modulestore.exceptions import ItemNotFoundError -FORUM_ROLE_ADMINISTRATOR = ugettext_noop('Administrator') -FORUM_ROLE_MODERATOR = ugettext_noop('Moderator') -FORUM_ROLE_GROUP_MODERATOR = ugettext_noop('Group Moderator') -FORUM_ROLE_COMMUNITY_TA = ugettext_noop('Community TA') -FORUM_ROLE_STUDENT = ugettext_noop('Student') +FORUM_ROLE_ADMINISTRATOR = gettext_noop('Administrator') +FORUM_ROLE_MODERATOR = gettext_noop('Moderator') +FORUM_ROLE_GROUP_MODERATOR = gettext_noop('Group Moderator') +FORUM_ROLE_COMMUNITY_TA = gettext_noop('Community TA') +FORUM_ROLE_STUDENT = gettext_noop('Student') @receiver(post_save, sender=CourseEnrollment) diff --git a/openedx/core/djangoapps/django_comment_common/signals.py b/openedx/core/djangoapps/django_comment_common/signals.py index 01391823cdd6..cc2612f88ef8 100644 --- a/openedx/core/djangoapps/django_comment_common/signals.py +++ b/openedx/core/djangoapps/django_comment_common/signals.py @@ -4,14 +4,15 @@ from django.dispatch import Signal -thread_created = Signal(providing_args=['user', 'post']) -thread_edited = Signal(providing_args=['user', 'post']) -thread_voted = Signal(providing_args=['user', 'post']) -thread_deleted = Signal(providing_args=['user', 'post']) -thread_followed = Signal(providing_args=['user', 'post']) -thread_unfollowed = Signal(providing_args=['user', 'post']) -comment_created = Signal(providing_args=['user', 'post']) -comment_edited = Signal(providing_args=['user', 'post']) -comment_voted = Signal(providing_args=['user', 'post']) -comment_deleted = Signal(providing_args=['user', 'post']) -comment_endorsed = Signal(providing_args=['user', 'post']) +# Same providing_args=['user', 'post'] for all following signals. +thread_created = Signal() +thread_edited = Signal() +thread_voted = Signal() +thread_deleted = Signal() +thread_followed = Signal() +thread_unfollowed = Signal() +comment_created = Signal() +comment_edited = Signal() +comment_voted = Signal() +comment_deleted = Signal() +comment_endorsed = Signal() diff --git a/openedx/core/djangoapps/embargo/forms.py b/openedx/core/djangoapps/embargo/forms.py index 9f1ab4c16a0a..5faa1ea5fb9e 100644 --- a/openedx/core/djangoapps/embargo/forms.py +++ b/openedx/core/djangoapps/embargo/forms.py @@ -5,7 +5,7 @@ import ipaddress from django import forms -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey diff --git a/openedx/core/djangoapps/embargo/models.py b/openedx/core/djangoapps/embargo/models.py index 2f9c97dc6516..653012cedca3 100644 --- a/openedx/core/djangoapps/embargo/models.py +++ b/openedx/core/djangoapps/embargo/models.py @@ -21,8 +21,8 @@ from django.db import models from django.db.models.signals import post_delete, post_save from django.urls import reverse -from django.utils.translation import ugettext as _ -from django.utils.translation import ugettext_lazy +from django.utils.translation import gettext as _ +from django.utils.translation import gettext_lazy from django_countries import countries from django_countries.fields import CountryField from opaque_keys.edx.django.models import CourseKeyField @@ -132,26 +132,26 @@ class RestrictedCourse(models.Model): course_key = CourseKeyField( max_length=255, db_index=True, unique=True, - help_text=ugettext_lazy("The course key for the restricted course.") + help_text=gettext_lazy("The course key for the restricted course.") ) enroll_msg_key = models.CharField( max_length=255, choices=ENROLL_MSG_KEY_CHOICES, default='default', - help_text=ugettext_lazy("The message to show when a user is blocked from enrollment.") + help_text=gettext_lazy("The message to show when a user is blocked from enrollment.") ) access_msg_key = models.CharField( max_length=255, choices=COURSEWARE_MSG_KEY_CHOICES, default='default', - help_text=ugettext_lazy("The message to show when a user is blocked from accessing a course.") + help_text=gettext_lazy("The message to show when a user is blocked from accessing a course.") ) disable_access_check = models.BooleanField( default=False, - help_text=ugettext_lazy( + help_text=gettext_lazy( "Allow users who enrolled in an allowed country " "to access restricted courses from excluded countries." ) @@ -380,7 +380,7 @@ class Country(models.Model): """ country = CountryField( db_index=True, unique=True, - help_text=ugettext_lazy("Two character ISO country code.") + help_text=gettext_lazy("Two character ISO country code.") ) def __str__(self): @@ -425,7 +425,7 @@ class CountryAccessRule(models.Model): max_length=255, choices=RULE_TYPE_CHOICES, default=BLACKLIST_RULE, - help_text=ugettext_lazy( + help_text=gettext_lazy( "Whether to include or exclude the given course. " "If whitelist countries are specified, then ONLY users from whitelisted countries " "will be able to access the course. If blacklist countries are specified, then " @@ -435,13 +435,13 @@ class CountryAccessRule(models.Model): restricted_course = models.ForeignKey( "RestrictedCourse", - help_text=ugettext_lazy("The course to which this rule applies."), + help_text=gettext_lazy("The course to which this rule applies."), on_delete=models.CASCADE, ) country = models.ForeignKey( "Country", - help_text=ugettext_lazy("The country to which this rule applies."), + help_text=gettext_lazy("The country to which this rule applies."), on_delete=models.CASCADE, ) diff --git a/openedx/core/djangoapps/lang_pref/api.py b/openedx/core/djangoapps/lang_pref/api.py index 2874f02c2eb1..a937e81f8ee6 100644 --- a/openedx/core/djangoapps/lang_pref/api.py +++ b/openedx/core/djangoapps/lang_pref/api.py @@ -4,7 +4,7 @@ from collections import namedtuple from django.conf import settings -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from openedx.core.djangoapps.dark_lang.models import DarkLangConfig from openedx.core.djangoapps.site_configuration.helpers import get_value diff --git a/openedx/core/djangoapps/oauth_dispatch/models.py b/openedx/core/djangoapps/oauth_dispatch/models.py index a2c57a3debc1..2e635167e4c7 100644 --- a/openedx/core/djangoapps/oauth_dispatch/models.py +++ b/openedx/core/djangoapps/oauth_dispatch/models.py @@ -7,7 +7,7 @@ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django_mysql.models import ListCharField from oauth2_provider.settings import oauth2_settings from organizations.models import Organization diff --git a/openedx/core/djangoapps/password_policy/apps.py b/openedx/core/djangoapps/password_policy/apps.py index 3c7d0dcfc476..ffc8145b0fed 100644 --- a/openedx/core/djangoapps/password_policy/apps.py +++ b/openedx/core/djangoapps/password_policy/apps.py @@ -6,7 +6,7 @@ from dateutil.parser import parse as parse_date from django.apps import AppConfig from django.conf import settings -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from edx_django_utils.plugins import PluginSettings from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType diff --git a/openedx/core/djangoapps/password_policy/compliance.py b/openedx/core/djangoapps/password_policy/compliance.py index 3c6e112a98f2..78e5ae902beb 100644 --- a/openedx/core/djangoapps/password_policy/compliance.py +++ b/openedx/core/djangoapps/password_policy/compliance.py @@ -6,7 +6,7 @@ import pytz from django.conf import settings -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from openedx.core.djangolib.markup import HTML from common.djangoapps.util.date_utils import DEFAULT_SHORT_DATE_FORMAT, strftime_localized diff --git a/openedx/core/djangoapps/profile_images/images.py b/openedx/core/djangoapps/profile_images/images.py index 63a367b05635..0df9ee3cba0b 100644 --- a/openedx/core/djangoapps/profile_images/images.py +++ b/openedx/core/djangoapps/profile_images/images.py @@ -11,7 +11,7 @@ import piexif from django.conf import settings from django.core.files.base import ContentFile -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from PIL import Image from openedx.core.djangoapps.user_api.accounts.image_helpers import get_profile_image_storage diff --git a/openedx/core/djangoapps/profile_images/views.py b/openedx/core/djangoapps/profile_images/views.py index b20bce17e50d..b88b3ad32bdb 100644 --- a/openedx/core/djangoapps/profile_images/views.py +++ b/openedx/core/djangoapps/profile_images/views.py @@ -8,7 +8,7 @@ import logging from contextlib import closing -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication from edx_rest_framework_extensions.auth.session.authentication import SessionAuthenticationAllowInactiveUser from pytz import UTC diff --git a/openedx/core/djangoapps/programs/migrations/0001_initial.py b/openedx/core/djangoapps/programs/migrations/0001_initial.py index 0be3ac89fb7d..f7f09cc01359 100644 --- a/openedx/core/djangoapps/programs/migrations/0001_initial.py +++ b/openedx/core/djangoapps/programs/migrations/0001_initial.py @@ -19,7 +19,7 @@ class Migration(migrations.Migration): ('internal_service_url', models.URLField(verbose_name='Internal Service URL')), ('public_service_url', models.URLField(verbose_name='Public Service URL')), ('api_version_number', models.IntegerField(verbose_name='API Version')), - ('enable_student_dashboard', models.NullBooleanField(verbose_name='Enable Student Dashboard Displays')), + ('enable_student_dashboard', models.BooleanField(verbose_name='Enable Student Dashboard Displays', null=True)), ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), ], options={ diff --git a/openedx/core/djangoapps/programs/models.py b/openedx/core/djangoapps/programs/models.py index b524d39b9c30..81345829eb46 100644 --- a/openedx/core/djangoapps/programs/models.py +++ b/openedx/core/djangoapps/programs/models.py @@ -1,7 +1,7 @@ """Models providing Programs support for the LMS and Studio.""" from config_models.models import ConfigurationModel from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class ProgramsApiConfig(ConfigurationModel): diff --git a/openedx/core/djangoapps/safe_sessions/middleware.py b/openedx/core/djangoapps/safe_sessions/middleware.py index 9bfe1e1b476f..ec27c27b3fc0 100644 --- a/openedx/core/djangoapps/safe_sessions/middleware.py +++ b/openedx/core/djangoapps/safe_sessions/middleware.py @@ -163,7 +163,7 @@ def create(cls, session_id, user_id): safe_cookie_data = SafeCookieData( cls.CURRENT_VERSION, session_id, - key_salt=get_random_string(), + key_salt=get_random_string(12), signature=None, ) safe_cookie_data.sign(user_id) diff --git a/openedx/core/djangoapps/schedules/admin.py b/openedx/core/djangoapps/schedules/admin.py index 0fcc64a28d9d..4f5a9cad7b83 100644 --- a/openedx/core/djangoapps/schedules/admin.py +++ b/openedx/core/djangoapps/schedules/admin.py @@ -7,7 +7,7 @@ from django.db.models import F from django.urls import reverse from django.utils.html import format_html -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from opaque_keys.edx.keys import CourseKey from openedx.core.djangoapps.content.course_overviews.models import CourseOverview diff --git a/openedx/core/djangoapps/schedules/apps.py b/openedx/core/djangoapps/schedules/apps.py index cfd38349251d..69216097b06f 100644 --- a/openedx/core/djangoapps/schedules/apps.py +++ b/openedx/core/djangoapps/schedules/apps.py @@ -1,7 +1,7 @@ # lint-amnesty, pylint: disable=missing-module-docstring from django.apps import AppConfig -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from edx_django_utils.plugins import PluginSignals # lint-amnesty, pylint: disable=unused-import from openedx.core.djangoapps.plugins.constants import ProjectType # lint-amnesty, pylint: disable=unused-import diff --git a/openedx/core/djangoapps/schedules/models.py b/openedx/core/djangoapps/schedules/models.py index 0f6e2521bc18..2db574cf0e6c 100644 --- a/openedx/core/djangoapps/schedules/models.py +++ b/openedx/core/djangoapps/schedules/models.py @@ -3,7 +3,7 @@ from config_models.models import ConfigurationModel from django.contrib.sites.models import Site from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from model_utils import Choices from model_utils.models import TimeStampedModel from simple_history.models import HistoricalRecords diff --git a/openedx/core/djangoapps/self_paced/models.py b/openedx/core/djangoapps/self_paced/models.py index 34639bc80167..333214a9c696 100644 --- a/openedx/core/djangoapps/self_paced/models.py +++ b/openedx/core/djangoapps/self_paced/models.py @@ -5,7 +5,7 @@ from config_models.models import ConfigurationModel from django.db.models import BooleanField -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class SelfPacedConfiguration(ConfigurationModel): diff --git a/openedx/core/djangoapps/signals/signals.py b/openedx/core/djangoapps/signals/signals.py index 5798bf3dccb2..f995fd91e840 100644 --- a/openedx/core/djangoapps/signals/signals.py +++ b/openedx/core/djangoapps/signals/signals.py @@ -6,43 +6,39 @@ from django.dispatch import Signal # Signal that fires when a user is graded -COURSE_GRADE_CHANGED = Signal(providing_args=["user", "course_grade", "course_key", "deadline"]) +# providing_args=["user", "course_grade", "course_key", "deadline"] +COURSE_GRADE_CHANGED = Signal() # Signal that fires when a user is awarded a certificate in a course (in the certificates django app) # TODO: runtime coupling between apps will be reduced if this event is changed to carry a username # rather than a User object; however, this will require changes to the milestones and badges APIs -COURSE_CERT_CHANGED = Signal(providing_args=["user", "course_key", "mode", "status"]) -COURSE_CERT_AWARDED = Signal(providing_args=["user", "course_key", "mode", "status"]) -COURSE_CERT_REVOKED = Signal(providing_args=["user", "course_key", "mode", "status"]) -COURSE_CERT_DATE_CHANGE = Signal(providing_args=["course_key", "available_date"]) +# Same providing_args=["user", "course_key", "mode", "status"] for next 3 signals. +COURSE_CERT_CHANGED = Signal() +COURSE_CERT_AWARDED = Signal() +COURSE_CERT_REVOKED = Signal() +# providing_args=["course_key", "available_date"] +COURSE_CERT_DATE_CHANGE = Signal() - -COURSE_ASSESSMENT_GRADE_CHANGED = Signal( - providing_args=[ - 'user', - 'course_id', - 'subsection_id', - 'subsection_grade', - ] -) +# providing_args=['user', 'course_id', 'subsection_id', 'subsection_grade', ] +COURSE_ASSESSMENT_GRADE_CHANGED = Signal() # Signal that indicates that a user has passed a course. -COURSE_GRADE_NOW_PASSED = Signal( - providing_args=[ - 'user', # user object - 'course_id', # course.id - ] -) +# providing_args=[ +# 'user', # user object +# 'course_id', # course.id +# ] +COURSE_GRADE_NOW_PASSED = Signal() #Signal that indicates a user is now failing a course that they had previously passed. -COURSE_GRADE_NOW_FAILED = Signal( - providing_args=[ - 'user', # user object - 'course_id', # course.id - 'grade', # CourseGrade object - ] -) +# providing_args=[ +# 'user', # user object +# 'course_id', # course.id +# 'grade', # CourseGrade object +# ] +COURSE_GRADE_NOW_FAILED = Signal() # Signal that indicates that a user has become verified for certificate purposes -LEARNER_NOW_VERIFIED = Signal(providing_args=['user']) +# providing_args=['user'] +LEARNER_NOW_VERIFIED = Signal() -USER_ACCOUNT_ACTIVATED = Signal(providing_args=["user"]) # Signal indicating email verification +# providing_args=['user'] +USER_ACCOUNT_ACTIVATED = Signal() # Signal indicating email verification diff --git a/openedx/core/djangoapps/site_configuration/context_processors.py b/openedx/core/djangoapps/site_configuration/context_processors.py index a92d8d654137..b3ba9826f291 100644 --- a/openedx/core/djangoapps/site_configuration/context_processors.py +++ b/openedx/core/djangoapps/site_configuration/context_processors.py @@ -4,7 +4,7 @@ from django.conf import settings -from django.utils.http import urlquote_plus +from urllib.parse import quote_plus from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers @@ -15,6 +15,6 @@ def configuration_context(request): """ return { 'platform_name': configuration_helpers.get_value('platform_name', settings.PLATFORM_NAME), - 'current_url': urlquote_plus(request.build_absolute_uri(request.path)), - 'current_site_url': urlquote_plus(request.build_absolute_uri('/')), + 'current_url': quote_plus(request.build_absolute_uri(request.path)), + 'current_site_url': quote_plus(request.build_absolute_uri('/')), } diff --git a/openedx/core/djangoapps/theming/views.py b/openedx/core/djangoapps/theming/views.py index 0d263e07b475..0b7f45ae9d15 100644 --- a/openedx/core/djangoapps/theming/views.py +++ b/openedx/core/djangoapps/theming/views.py @@ -9,7 +9,7 @@ from django.shortcuts import redirect from django.template.loader import render_to_string from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from web_fragments.fragment import Fragment from openedx.core.djangoapps.plugin_api.views import EdxFragmentView diff --git a/openedx/core/djangoapps/user_api/accounts/__init__.py b/openedx/core/djangoapps/user_api/accounts/__init__.py index 7cc88ec3ca94..49dd0fff8c1e 100644 --- a/openedx/core/djangoapps/user_api/accounts/__init__.py +++ b/openedx/core/djangoapps/user_api/accounts/__init__.py @@ -4,7 +4,7 @@ from django.conf import settings from django.utils.text import format_lazy -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ # The maximum length for the bio ("about me") account field BIO_MAX_LENGTH = 300 diff --git a/openedx/core/djangoapps/user_api/accounts/api.py b/openedx/core/djangoapps/user_api/accounts/api.py index 436ce6f6ab45..fce5d81aef90 100644 --- a/openedx/core/djangoapps/user_api/accounts/api.py +++ b/openedx/core/djangoapps/user_api/accounts/api.py @@ -10,7 +10,7 @@ from django.core.exceptions import ObjectDoesNotExist from django.core.validators import ValidationError, validate_email from django.utils.translation import override as override_language -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from edx_name_affirmation.name_change_validator import NameChangeValidator from edx_name_affirmation.toggles import is_verified_name_enabled from pytz import UTC diff --git a/openedx/core/djangoapps/user_api/accounts/settings_views.py b/openedx/core/djangoapps/user_api/accounts/settings_views.py index 1478313cf6f8..ab321638d2fd 100644 --- a/openedx/core/djangoapps/user_api/accounts/settings_views.py +++ b/openedx/core/djangoapps/user_api/accounts/settings_views.py @@ -10,7 +10,7 @@ from django.contrib.auth.decorators import login_required from django.shortcuts import redirect from django.urls import reverse -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.views.decorators.http import require_http_methods from django_countries import countries