diff --git a/lms/djangoapps/course_home_api/migrations/0001_initial.py b/lms/djangoapps/course_home_api/migrations/0001_initial.py index d7068e546a91..22f16f5ca4b0 100644 --- a/lms/djangoapps/course_home_api/migrations/0001_initial.py +++ b/lms/djangoapps/course_home_api/migrations/0001_initial.py @@ -22,7 +22,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), - ('enabled', models.NullBooleanField(default=None, verbose_name='Enabled')), + ('enabled', models.BooleanField(default=None, null=True, verbose_name='Enabled')), ('org', models.CharField(blank=True, db_index=True, help_text='Configure values for all course runs associated with this Organization. This is the organization string (i.e. edX, MITx).', max_length=255, null=True)), ('org_course', models.CharField(blank=True, db_index=True, help_text="Configure values for all course runs associated with this course. This is should be formatted as 'org+course' (i.e. MITx+6.002x, HarvardX+CS50).", max_length=255, null=True, validators=[openedx.core.djangoapps.config_model_utils.models.validate_course_in_org], verbose_name='Course in Org')), ('disabled', models.NullBooleanField(default=None, verbose_name='Disabled')), diff --git a/openedx/core/djangoapps/ace_common/apps.py b/openedx/core/djangoapps/ace_common/apps.py index c436712e6460..70ba9eaf1b36 100644 --- a/openedx/core/djangoapps/ace_common/apps.py +++ b/openedx/core/djangoapps/ace_common/apps.py @@ -4,7 +4,7 @@ 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 PluginSettings from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType diff --git a/openedx/core/djangoapps/api_admin/admin.py b/openedx/core/djangoapps/api_admin/admin.py index 33fed249b6e0..9e62764d48e0 100644 --- a/openedx/core/djangoapps/api_admin/admin.py +++ b/openedx/core/djangoapps/api_admin/admin.py @@ -4,7 +4,7 @@ from config_models.admin import ConfigurationModelAdmin from django.contrib import admin from django.urls import reverse -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from openedx.core.djangoapps.api_admin.models import ApiAccessConfig, ApiAccessRequest from openedx.core.djangolib.markup import HTML, Text diff --git a/openedx/core/djangoapps/api_admin/forms.py b/openedx/core/djangoapps/api_admin/forms.py index 8f63c2f660a8..3f1dc1de5dac 100644 --- a/openedx/core/djangoapps/api_admin/forms.py +++ b/openedx/core/djangoapps/api_admin/forms.py @@ -3,7 +3,7 @@ from django import forms from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from openedx.core.djangoapps.api_admin.models import ApiAccessRequest, Catalog from openedx.core.djangoapps.api_admin.widgets import TermsOfServiceCheckboxInput diff --git a/openedx/core/djangoapps/api_admin/models.py b/openedx/core/djangoapps/api_admin/models.py index d6ed4ca41f17..8d947cd4a7e3 100644 --- a/openedx/core/djangoapps/api_admin/models.py +++ b/openedx/core/djangoapps/api_admin/models.py @@ -14,8 +14,8 @@ from django.db.models.signals import post_save, pre_save from django.dispatch import receiver from django.urls import reverse -from django.utils.translation import ugettext as _u -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext as _u +from django.utils.translation import gettext_lazy as _ from model_utils.models import TimeStampedModel diff --git a/openedx/core/djangoapps/api_admin/widgets.py b/openedx/core/djangoapps/api_admin/widgets.py index dee055bdda3c..45a8871afd46 100644 --- a/openedx/core/djangoapps/api_admin/widgets.py +++ b/openedx/core/djangoapps/api_admin/widgets.py @@ -5,9 +5,9 @@ from django.forms.utils import flatatt from django.forms.widgets import CheckboxInput from django.urls import reverse -from django.utils.encoding import force_text +from django.utils.encoding import force_str from django.utils.html import format_html -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers from openedx.core.djangolib.markup import HTML, Text @@ -25,7 +25,7 @@ def render(self, name, value, attrs=None, renderer=None): final_attrs['checked'] = 'checked' if not (value is True or value is False or value is None or value == ''): # Only add the 'value' attribute if a value is non-empty. - final_attrs['value'] = force_text(value) + final_attrs['value'] = force_str(value) # Translators: link_start and link_end are HTML tags for a link to the terms of service. # platform_name is the name of this Open edX installation. diff --git a/openedx/core/djangoapps/auth_exchange/forms.py b/openedx/core/djangoapps/auth_exchange/forms.py index 41318fba763d..ea175f910719 100644 --- a/openedx/core/djangoapps/auth_exchange/forms.py +++ b/openedx/core/djangoapps/auth_exchange/forms.py @@ -6,8 +6,8 @@ from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django.forms import CharField from django.conf import settings -from django.utils.encoding import smart_text -from django.utils.translation import ugettext as _ +from django.utils.encoding import smart_str +from django.utils.translation import gettext as _ from oauth2_provider.models import Application from requests import HTTPError from social_core.backends import oauth as social_oauth @@ -55,7 +55,7 @@ def to_python(self, value): value = value.split(' ') # Split values into list - return ' '.join([smart_text(val) for val in value]).split(' ') + return ' '.join([smart_str(val) for val in value]).split(' ') def validate(self, value): """ diff --git a/openedx/core/djangoapps/bookmarks/apps.py b/openedx/core/djangoapps/bookmarks/apps.py index c9c0a2943083..61ff98f6dc60 100644 --- a/openedx/core/djangoapps/bookmarks/apps.py +++ b/openedx/core/djangoapps/bookmarks/apps.py @@ -4,7 +4,7 @@ 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 PluginSettings, PluginURLs from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType diff --git a/openedx/core/djangoapps/bookmarks/views.py b/openedx/core/djangoapps/bookmarks/views.py index 046bfc0c68ec..d0ae4dc4c980 100644 --- a/openedx/core/djangoapps/bookmarks/views.py +++ b/openedx/core/djangoapps/bookmarks/views.py @@ -11,8 +11,8 @@ import eventtracking from django.conf import settings from django.core.exceptions import ObjectDoesNotExist -from django.utils.translation import ugettext as _ -from django.utils.translation import ugettext_noop +from django.utils.translation import gettext as _ +from django.utils.translation import gettext_noop import edx_api_doc_tools as apidocs from edx_rest_framework_extensions.paginators import DefaultPagination from opaque_keys import InvalidKeyError @@ -36,7 +36,7 @@ # Default error message for user -DEFAULT_USER_MESSAGE = ugettext_noop('An error has occurred. Please try again.') +DEFAULT_USER_MESSAGE = gettext_noop('An error has occurred. Please try again.') class BookmarksPagination(DefaultPagination): @@ -217,27 +217,27 @@ def post(self, request, *unused_args, **unused_kwargs): # lint-amnesty, pylint: Request data: {"usage_id": } """ if not request.data: - return self.error_response(ugettext_noop('No data provided.'), DEFAULT_USER_MESSAGE) + return self.error_response(gettext_noop('No data provided.'), DEFAULT_USER_MESSAGE) usage_id = request.data.get('usage_id', None) if not usage_id: - return self.error_response(ugettext_noop('Parameter usage_id not provided.'), DEFAULT_USER_MESSAGE) + return self.error_response(gettext_noop('Parameter usage_id not provided.'), DEFAULT_USER_MESSAGE) try: usage_key = UsageKey.from_string(unquote_slashes(usage_id)) except InvalidKeyError: - error_message = ugettext_noop('Invalid usage_id: {usage_id}.').format(usage_id=usage_id) + error_message = gettext_noop('Invalid usage_id: {usage_id}.').format(usage_id=usage_id) log.error(error_message) return self.error_response(error_message, DEFAULT_USER_MESSAGE) try: bookmark = api.create_bookmark(user=self.request.user, usage_key=usage_key) except ItemNotFoundError: - error_message = ugettext_noop('Block with usage_id: {usage_id} not found.').format(usage_id=usage_id) + error_message = gettext_noop('Block with usage_id: {usage_id} not found.').format(usage_id=usage_id) log.error(error_message) return self.error_response(error_message, DEFAULT_USER_MESSAGE) except BookmarksLimitReachedError: - error_message = ugettext_noop( + error_message = gettext_noop( 'You can create up to {max_num_bookmarks_per_course} bookmarks.' ' You must remove some bookmarks before you can add new ones.' ).format(max_num_bookmarks_per_course=settings.MAX_BOOKMARKS_PER_COURSE) @@ -307,7 +307,7 @@ def get_usage_key_or_error_response(self, usage_id): try: return UsageKey.from_string(usage_id) except InvalidKeyError: - error_message = ugettext_noop('Invalid usage_id: {usage_id}.').format(usage_id=usage_id) + error_message = gettext_noop('Invalid usage_id: {usage_id}.').format(usage_id=usage_id) log.error(error_message) return self.error_response(error_message, error_status=status.HTTP_404_NOT_FOUND) @@ -332,7 +332,7 @@ def get(self, request, username=None, usage_id=None): # lint-amnesty, pylint: d fields=self.fields_to_return(request.query_params) ) except ObjectDoesNotExist: - error_message = ugettext_noop( + error_message = gettext_noop( 'Bookmark with usage_id: {usage_id} does not exist.' ).format(usage_id=usage_id) log.error(error_message) @@ -352,7 +352,7 @@ def delete(self, request, username=None, usage_id=None): # pylint: disable=unus try: api.delete_bookmark(user=request.user, usage_key=usage_key_or_response) except ObjectDoesNotExist: - error_message = ugettext_noop( + error_message = gettext_noop( 'Bookmark with usage_id: {usage_id} does not exist.' ).format(usage_id=usage_id) log.error(error_message) diff --git a/openedx/core/djangoapps/catalog/models.py b/openedx/core/djangoapps/catalog/models.py index 182996df6a2d..e44a7839b38a 100644 --- a/openedx/core/djangoapps/catalog/models.py +++ b/openedx/core/djangoapps/catalog/models.py @@ -5,7 +5,7 @@ from django.conf import settings from django.contrib.auth import get_user_model from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from openedx.core.djangoapps.site_configuration import helpers diff --git a/openedx/core/djangoapps/config_model_utils/admin.py b/openedx/core/djangoapps/config_model_utils/admin.py index ea9e8499c071..cd896f448ffd 100644 --- a/openedx/core/djangoapps/config_model_utils/admin.py +++ b/openedx/core/djangoapps/config_model_utils/admin.py @@ -5,7 +5,7 @@ from config_models.admin import ConfigurationModelAdmin from django import forms -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.djangolib.markup import HTML, Text diff --git a/openedx/core/djangoapps/config_model_utils/models.py b/openedx/core/djangoapps/config_model_utils/models.py index d79c1a82c75c..11d4d6383a10 100644 --- a/openedx/core/djangoapps/config_model_utils/models.py +++ b/openedx/core/djangoapps/config_model_utils/models.py @@ -18,7 +18,7 @@ from django.core.exceptions import ValidationError from django.db import models from django.db.models import Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from openedx.core.djangoapps.content.course_overviews.models import CourseOverview from openedx.core.djangoapps.site_configuration.models import SiteConfiguration @@ -62,7 +62,7 @@ class Meta: KEY_FIELDS = ('site', 'org', 'org_course', 'course') STACKABLE_FIELDS = ('enabled',) - enabled = models.NullBooleanField(default=None, verbose_name=_("Enabled")) + enabled = models.BooleanField(default=None, verbose_name=_("Enabled"), null=True) site = models.ForeignKey( Site, on_delete=models.CASCADE, diff --git a/openedx/core/djangoapps/content/course_overviews/migrations/0024_overview_adds_has_highlights.py b/openedx/core/djangoapps/content/course_overviews/migrations/0024_overview_adds_has_highlights.py index a63459c7a770..78edced8698d 100644 --- a/openedx/core/djangoapps/content/course_overviews/migrations/0024_overview_adds_has_highlights.py +++ b/openedx/core/djangoapps/content/course_overviews/migrations/0024_overview_adds_has_highlights.py @@ -13,11 +13,11 @@ class Migration(migrations.Migration): migrations.AddField( model_name='courseoverview', name='has_highlights', - field=models.NullBooleanField(default=None), + field=models.BooleanField(default=None, null=True), ), migrations.AddField( model_name='historicalcourseoverview', name='has_highlights', - field=models.NullBooleanField(default=None), + field=models.BooleanField(default=None, null=True), ), ] diff --git a/openedx/core/djangoapps/content/course_overviews/models.py b/openedx/core/djangoapps/content/course_overviews/models.py index 5bb6d3a2414b..f5a09e9756e4 100644 --- a/openedx/core/djangoapps/content/course_overviews/models.py +++ b/openedx/core/djangoapps/content/course_overviews/models.py @@ -13,7 +13,7 @@ from django.db import models, transaction from django.db.models import Q from django.db.models.fields import ( - BooleanField, DateTimeField, DecimalField, FloatField, IntegerField, NullBooleanField, TextField + BooleanField, DateTimeField, DecimalField, FloatField, IntegerField, TextField ) from django.db.models.signals import post_save, post_delete from django.db.utils import IntegrityError @@ -132,7 +132,7 @@ class Meta: eligible_for_financial_aid = BooleanField(default=True) # Course highlight info, used to guide course update emails - has_highlights = NullBooleanField(default=None) # if None, you have to look up the answer yourself + has_highlights = BooleanField(null=True, default=None) # if None, you have to look up the answer yourself # Proctoring enable_proctored_exams = BooleanField(default=False) diff --git a/openedx/core/djangoapps/content_libraries/views.py b/openedx/core/djangoapps/content_libraries/views.py index 96e336ac1eff..fe9672a7a97a 100644 --- a/openedx/core/djangoapps/content_libraries/views.py +++ b/openedx/core/djangoapps/content_libraries/views.py @@ -24,7 +24,7 @@ from django.shortcuts import get_object_or_404 from django.urls import reverse from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.views.decorators.clickjacking import xframe_options_exempt from django.views.decorators.csrf import csrf_exempt from django.views.generic.base import TemplateResponseMixin diff --git a/openedx/core/djangoapps/cors_csrf/models.py b/openedx/core/djangoapps/cors_csrf/models.py index 1587154b98be..386bdf228003 100644 --- a/openedx/core/djangoapps/cors_csrf/models.py +++ b/openedx/core/djangoapps/cors_csrf/models.py @@ -4,7 +4,7 @@ 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 XDomainProxyConfiguration(ConfigurationModel): diff --git a/openedx/core/djangoapps/course_apps/signals.py b/openedx/core/djangoapps/course_apps/signals.py index 393cf9f99502..95e55b0c3e0a 100644 --- a/openedx/core/djangoapps/course_apps/signals.py +++ b/openedx/core/djangoapps/course_apps/signals.py @@ -5,4 +5,5 @@ # A signal that's dispatched when the status for a course app that's available for a course # isn't present in the `CourseAppStatus` table. -COURSE_APP_STATUS_INIT = Signal(providing_args=["course_key", "is_enabled"]) +# providing_args=["course_key", "is_enabled"] +COURSE_APP_STATUS_INIT = Signal() diff --git a/openedx/core/djangoapps/course_date_signals/migrations/0001_initial.py b/openedx/core/djangoapps/course_date_signals/migrations/0001_initial.py index 7f0d28cc1cc7..555b62d79760 100644 --- a/openedx/core/djangoapps/course_date_signals/migrations/0001_initial.py +++ b/openedx/core/djangoapps/course_date_signals/migrations/0001_initial.py @@ -23,7 +23,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), - ('enabled', models.NullBooleanField(default=None, verbose_name='Enabled')), + ('enabled', models.BooleanField(default=None, verbose_name='Enabled', null=True)), ('org', models.CharField(blank=True, db_index=True, help_text='Configure values for all course runs associated with this Organization. This is the organization string (i.e. edX, MITx).', max_length=255, null=True)), ('org_course', models.CharField(blank=True, db_index=True, help_text="Configure values for all course runs associated with this course. This is should be formatted as 'org+course' (i.e. MITx+6.002x, HarvardX+CS50).", max_length=255, null=True, validators=[openedx.core.djangoapps.config_model_utils.models.validate_course_in_org], verbose_name='Course in Org')), ('changed_by', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='Changed by')), diff --git a/openedx/core/djangoapps/course_groups/cohorts.py b/openedx/core/djangoapps/course_groups/cohorts.py index 2ce99d046a41..a7298161f2fe 100644 --- a/openedx/core/djangoapps/course_groups/cohorts.py +++ b/openedx/core/djangoapps/course_groups/cohorts.py @@ -14,7 +14,7 @@ from django.db.models.signals import m2m_changed, post_save from django.dispatch import receiver from django.http import Http404 -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from edx_django_utils.cache import RequestCache from eventtracking import tracker diff --git a/openedx/core/djangoapps/course_groups/signals/signals.py b/openedx/core/djangoapps/course_groups/signals/signals.py index c283ee483eeb..e474fc54da7a 100644 --- a/openedx/core/djangoapps/course_groups/signals/signals.py +++ b/openedx/core/djangoapps/course_groups/signals/signals.py @@ -4,4 +4,5 @@ from django.dispatch import Signal -COHORT_MEMBERSHIP_UPDATED = Signal(providing_args=['user', 'course_key']) +# providing_args=['user', 'course_key'] +COHORT_MEMBERSHIP_UPDATED = Signal() diff --git a/openedx/core/djangoapps/course_groups/views.py b/openedx/core/djangoapps/course_groups/views.py index e65db53ffe10..4e9b7a66cf8c 100644 --- a/openedx/core/djangoapps/course_groups/views.py +++ b/openedx/core/djangoapps/course_groups/views.py @@ -12,7 +12,7 @@ from django.core.paginator import EmptyPage, Paginator from django.http import Http404, HttpResponseBadRequest from django.urls import reverse -from django.utils.translation import ugettext +from django.utils.translation import gettext from django.views.decorators.csrf import ensure_csrf_cookie from django.views.decorators.http import require_http_methods, require_POST from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication @@ -196,7 +196,7 @@ def cohort_handler(request, course_key_string, cohort_id=None): cohort = cohorts.get_cohort_by_id(course_key, cohort_id) if name != cohort.name: if cohorts.is_cohort_exists(course_key, name): - err_msg = ugettext("A cohort with the same name already exists.") + err_msg = gettext("A cohort with the same name already exists.") return JsonResponse({"error": str(err_msg)}, 400) cohort.name = name cohort.save() diff --git a/openedx/core/djangoapps/courseware_api/views.py b/openedx/core/djangoapps/courseware_api/views.py index 2a708279b5e0..6482401497d8 100644 --- a/openedx/core/djangoapps/courseware_api/views.py +++ b/openedx/core/djangoapps/courseware_api/views.py @@ -5,7 +5,7 @@ from completion.exceptions import UnavailableCompletionData from completion.utilities import get_key_to_last_completed_block from django.urls import reverse -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from edx_django_utils.cache import TieredCache from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication from edx_rest_framework_extensions.auth.session.authentication import SessionAuthenticationAllowInactiveUser diff --git a/openedx/core/djangoapps/credentials/apps.py b/openedx/core/djangoapps/credentials/apps.py index 6a12ac083c4c..b70cf0461db9 100644 --- a/openedx/core/djangoapps/credentials/apps.py +++ b/openedx/core/djangoapps/credentials/apps.py @@ -4,7 +4,7 @@ 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 PluginSettings, PluginSignals from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType diff --git a/openedx/core/djangoapps/credentials/models.py b/openedx/core/djangoapps/credentials/models.py index d2c3cf7be360..716d0e96aeec 100644 --- a/openedx/core/djangoapps/credentials/models.py +++ b/openedx/core/djangoapps/credentials/models.py @@ -9,7 +9,7 @@ from django.conf import settings from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from openedx.core.djangoapps.site_configuration import helpers diff --git a/openedx/core/djangoapps/credit/email_utils.py b/openedx/core/djangoapps/credit/email_utils.py index edbcb19f40f2..44eba6adc00c 100644 --- a/openedx/core/djangoapps/credit/email_utils.py +++ b/openedx/core/djangoapps/credit/email_utils.py @@ -17,7 +17,7 @@ from django.core.cache import cache from django.core.mail import EmailMessage, SafeMIMEText from django.urls import reverse -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from eventtracking import tracker from common.djangoapps.edxmako.shortcuts import render_to_string diff --git a/openedx/core/djangoapps/credit/exceptions.py b/openedx/core/djangoapps/credit/exceptions.py index 7f13004e9b14..a63f950c982e 100644 --- a/openedx/core/djangoapps/credit/exceptions.py +++ b/openedx/core/djangoapps/credit/exceptions.py @@ -1,7 +1,7 @@ """Exceptions raised by the credit API. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import status from rest_framework.exceptions import APIException diff --git a/openedx/core/djangoapps/credit/models.py b/openedx/core/djangoapps/credit/models.py index 622c36e0bbb6..2a9fa2088551 100644 --- a/openedx/core/djangoapps/credit/models.py +++ b/openedx/core/djangoapps/credit/models.py @@ -17,8 +17,8 @@ from django.core.validators import RegexValidator from django.db import IntegrityError, models, transaction from django.dispatch import receiver -from django.utils.translation import ugettext as _ # lint-amnesty, pylint: disable=unused-import -from django.utils.translation import ugettext_lazy +from django.utils.translation import gettext as _ # lint-amnesty, pylint: disable=unused-import +from django.utils.translation import gettext_lazy from edx_django_utils.cache import RequestCache from jsonfield.fields import JSONField from model_utils.models import TimeStampedModel @@ -51,7 +51,7 @@ class CreditProvider(TimeStampedModel): code="invalid_provider_id", ) ], - help_text=ugettext_lazy( + help_text=gettext_lazy( "Unique identifier for this credit provider. " "Only alphanumeric characters and hyphens (-) are allowed. " "The identifier is case-sensitive." @@ -60,17 +60,17 @@ class CreditProvider(TimeStampedModel): active = models.BooleanField( default=True, - help_text=ugettext_lazy("Whether the credit provider is currently enabled.") + help_text=gettext_lazy("Whether the credit provider is currently enabled.") ) display_name = models.CharField( max_length=255, - help_text=ugettext_lazy("Name of the credit provider displayed to users") + help_text=gettext_lazy("Name of the credit provider displayed to users") ) enable_integration = models.BooleanField( default=False, - help_text=ugettext_lazy( + help_text=gettext_lazy( "When true, automatically notify the credit provider " "when a user requests credit. " "In order for this to work, a shared secret key MUST be configured " @@ -80,7 +80,7 @@ class CreditProvider(TimeStampedModel): provider_url = models.URLField( default="", - help_text=ugettext_lazy( + help_text=gettext_lazy( "URL of the credit provider. If automatic integration is " "enabled, this will the the end-point that we POST to " "to notify the provider of a credit request. Otherwise, the " @@ -91,7 +91,7 @@ class CreditProvider(TimeStampedModel): provider_status_url = models.URLField( default="", - help_text=ugettext_lazy( + help_text=gettext_lazy( "URL from the credit provider where the user can check the status " "of his or her request for credit. This is displayed to students " "*after* they have requested credit." @@ -100,7 +100,7 @@ class CreditProvider(TimeStampedModel): provider_description = models.TextField( default="", - help_text=ugettext_lazy( + help_text=gettext_lazy( "Description for the credit provider displayed to users." ) ) @@ -108,7 +108,7 @@ class CreditProvider(TimeStampedModel): fulfillment_instructions = models.TextField( null=True, blank=True, - help_text=ugettext_lazy( + help_text=gettext_lazy( "Plain text or html content for displaying further steps on " "receipt page *after* paying for the credit to get credit for a " "credit course against a credit provider." @@ -117,7 +117,7 @@ class CreditProvider(TimeStampedModel): eligibility_email_message = models.TextField( default="", - help_text=ugettext_lazy( + help_text=gettext_lazy( "Plain text or html content for displaying custom message inside " "credit eligibility email content which is sent when user has met " "all credit eligibility requirements." @@ -126,7 +126,7 @@ class CreditProvider(TimeStampedModel): receipt_email_message = models.TextField( default="", - help_text=ugettext_lazy( + help_text=gettext_lazy( "Plain text or html content for displaying custom message inside " "credit receipt email content which is sent *after* paying to get " "credit for a credit course." @@ -136,7 +136,7 @@ class CreditProvider(TimeStampedModel): thumbnail_url = models.URLField( default="", max_length=255, - help_text=ugettext_lazy( + help_text=gettext_lazy( "Thumbnail image url of the credit provider." ) ) @@ -446,7 +446,7 @@ class CreditRequirementStatus(TimeStampedModel): class Meta: unique_together = ('username', 'requirement') - verbose_name_plural = ugettext_lazy('Credit requirement statuses') + verbose_name_plural = gettext_lazy('Credit requirement statuses') @classmethod def get_statuses(cls, requirements, username): @@ -558,7 +558,7 @@ class CreditEligibility(TimeStampedModel): # we need to override the deadline for particular students. deadline = models.DateTimeField( default=default_deadline_for_credit_eligibility, - help_text=ugettext_lazy("Deadline for purchasing and requesting credit.") + help_text=gettext_lazy("Deadline for purchasing and requesting credit.") ) class Meta: @@ -783,9 +783,9 @@ class CreditConfig(ConfigurationModel): CACHE_KEY = 'credit.providers.api.data' cache_ttl = models.PositiveIntegerField( - verbose_name=ugettext_lazy("Cache Time To Live"), + verbose_name=gettext_lazy("Cache Time To Live"), default=0, - help_text=ugettext_lazy( + help_text=gettext_lazy( "Specified in seconds. Enable caching by setting this to a value greater than 0." ) ) diff --git a/openedx/core/djangoapps/dark_lang/views.py b/openedx/core/djangoapps/dark_lang/views.py index a2453fb1d06d..0865406408e3 100644 --- a/openedx/core/djangoapps/dark_lang/views.py +++ b/openedx/core/djangoapps/dark_lang/views.py @@ -9,7 +9,7 @@ from django.template.loader import render_to_string from django.utils.decorators import method_decorator from django.utils.translation import LANGUAGE_SESSION_KEY -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from web_fragments.fragment import Fragment from openedx.core.djangoapps.dark_lang import DARK_LANGUAGE_KEY diff --git a/openedx/core/djangoapps/debug/views.py b/openedx/core/djangoapps/debug/views.py index ec1c48155fca..6a3bcc40f280 100644 --- a/openedx/core/djangoapps/debug/views.py +++ b/openedx/core/djangoapps/debug/views.py @@ -8,7 +8,7 @@ import bleach from django.http import HttpResponseNotFound from django.template import TemplateDoesNotExist -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from common.djangoapps.edxmako.shortcuts import render_to_response from openedx.core.djangoapps.util.user_messages import PageLevelMessages diff --git a/openedx/core/djangoapps/discussions/migrations/0002_add_provider_filter.py b/openedx/core/djangoapps/discussions/migrations/0002_add_provider_filter.py index de8d1479eb94..b8320e580cf3 100644 --- a/openedx/core/djangoapps/discussions/migrations/0002_add_provider_filter.py +++ b/openedx/core/djangoapps/discussions/migrations/0002_add_provider_filter.py @@ -22,7 +22,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), - ('enabled', models.NullBooleanField(default=None, verbose_name='Enabled')), + ('enabled', models.BooleanField(default=None, verbose_name='Enabled', null=True)), ('org', models.CharField(blank=True, db_index=True, help_text='Configure values for all course runs associated with this Organization. This is the organization string (i.e. edX, MITx).', max_length=255, null=True)), ('org_course', models.CharField(blank=True, db_index=True, help_text="Configure values for all course runs associated with this course. This is should be formatted as 'org+course' (i.e. MITx+6.002x, HarvardX+CS50).", max_length=255, null=True, validators=[openedx.core.djangoapps.config_model_utils.models.validate_course_in_org], verbose_name='Course in Org')), ('allow', django_mysql.models.ListCharField(models.CharField(choices=[('cs_comments_service', 'cs_comments_service'), ('lti', 'lti'), ('test', 'test')], max_length=20), blank=True, help_text='Comma-separated list of providers to allow, eg: cs_comments_service,lti,test', max_length=63, size=3, verbose_name='Allow List')), diff --git a/openedx/core/djangoapps/discussions/models.py b/openedx/core/djangoapps/discussions/models.py index 50944b92ad40..ccd74e749257 100644 --- a/openedx/core/djangoapps/discussions/models.py +++ b/openedx/core/djangoapps/discussions/models.py @@ -10,7 +10,7 @@ from django.conf import settings from django.core.exceptions import ValidationError 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 jsonfield import JSONField from lti_consumer.models import LtiConfiguration diff --git a/openedx/features/content_type_gating/migrations/0001_initial.py b/openedx/features/content_type_gating/migrations/0001_initial.py index eb0499ba787f..6404b30913bc 100644 --- a/openedx/features/content_type_gating/migrations/0001_initial.py +++ b/openedx/features/content_type_gating/migrations/0001_initial.py @@ -22,7 +22,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), - ('enabled', models.NullBooleanField(default=None, verbose_name='Enabled')), + ('enabled', models.BooleanField(default=None, null=True, verbose_name='Enabled')), ('org', models.CharField(blank=True, db_index=True, max_length=255, null=True)), ('enabled_as_of', models.DateField(blank=True, default=None, null=True, verbose_name='Enabled As Of')), ('studio_override_enabled', models.NullBooleanField(default=None, verbose_name='Studio Override Enabled')), diff --git a/openedx/features/course_duration_limits/migrations/0001_initial.py b/openedx/features/course_duration_limits/migrations/0001_initial.py index c233db490458..1bb2b7ed17a3 100644 --- a/openedx/features/course_duration_limits/migrations/0001_initial.py +++ b/openedx/features/course_duration_limits/migrations/0001_initial.py @@ -22,7 +22,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), - ('enabled', models.NullBooleanField(default=None, verbose_name='Enabled')), + ('enabled', models.BooleanField(default=None, null=True, verbose_name='Enabled')), ('org', models.CharField(blank=True, db_index=True, max_length=255, null=True)), ('enabled_as_of', models.DateField(blank=True, default=None, null=True, verbose_name='Enabled As Of')), ('changed_by', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='Changed by')), diff --git a/openedx/features/discounts/migrations/0001_initial.py b/openedx/features/discounts/migrations/0001_initial.py index 6cdbb71ff68e..68e7ad90b9e9 100644 --- a/openedx/features/discounts/migrations/0001_initial.py +++ b/openedx/features/discounts/migrations/0001_initial.py @@ -24,7 +24,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), - ('enabled', models.NullBooleanField(default=None, verbose_name='Enabled')), + ('enabled', models.BooleanField(default=None, null=True, verbose_name='Enabled')), ('org', models.CharField(blank=True, db_index=True, help_text='Configure values for all course runs associated with this Organization. This is the organization string (i.e. edX, MITx).', max_length=255, null=True)), ('org_course', models.CharField(blank=True, db_index=True, help_text="Configure values for all course runs associated with this course. This is should be formatted as 'org+course' (i.e. MITx+6.002x, HarvardX+CS50).", max_length=255, null=True, validators=[openedx.core.djangoapps.config_model_utils.models.validate_course_in_org], verbose_name='Course in Org')), ('disabled', models.NullBooleanField(default=None, verbose_name='Disabled')), diff --git a/openedx/features/discounts/migrations/0002_auto_20191022_1720.py b/openedx/features/discounts/migrations/0002_auto_20191022_1720.py index 32d2e1c3ccf8..022a9e635f1a 100644 --- a/openedx/features/discounts/migrations/0002_auto_20191022_1720.py +++ b/openedx/features/discounts/migrations/0002_auto_20191022_1720.py @@ -22,7 +22,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), - ('enabled', models.NullBooleanField(default=None, verbose_name='Enabled')), + ('enabled', models.BooleanField(default=None, null=True, verbose_name='Enabled')), ('org', models.CharField(blank=True, db_index=True, help_text='Configure values for all course runs associated with this Organization. This is the organization string (i.e. edX, MITx).', max_length=255, null=True)), ('org_course', models.CharField(blank=True, db_index=True, help_text="Configure values for all course runs associated with this course. This is should be formatted as 'org+course' (i.e. MITx+6.002x, HarvardX+CS50).", max_length=255, null=True, validators=[openedx.core.djangoapps.config_model_utils.models.validate_course_in_org], verbose_name='Course in Org')), ('percentage', models.PositiveIntegerField()),