Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openedx/features/calendar_sync/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


from django.urls import reverse
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

from openedx.features.calendar_sync.api import SUBSCRIBE, UNSUBSCRIBE
from openedx.features.calendar_sync.models import UserCalendarSyncConfig
Expand Down
2 changes: 1 addition & 1 deletion openedx/features/calendar_sync/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from email.mime.text import MIMEText
from django.conf import settings
from django.utils.html import format_html
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
import os # lint-amnesty, pylint: disable=wrong-import-order
import boto3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Migration(migrations.Migration):
('enabled', models.NullBooleanField(default=None, 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')),
('studio_override_enabled', models.BooleanField(default=None, verbose_name='Studio Override Enabled', null=True)),
('changed_by', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='Changed by')),
('course', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='course_overviews.CourseOverview')),
('site', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='sites.Site')),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='contenttypegatingconfig',
name='studio_override_enabled',
field=models.NullBooleanField(default=None, help_text='Allow Feature Based Enrollment visibility to be overriden on a per-component basis in Studio.', verbose_name='Studio Override Enabled'),
field=models.BooleanField(blank=True, default=None, help_text='Allow Feature Based Enrollment visibility to be overriden on a per-component basis in Studio.', null=True, verbose_name='Studio Override Enabled'),
),
]
7 changes: 4 additions & 3 deletions openedx/features/content_type_gating/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.db import models
from django.utils import timezone

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from openedx.core.djangoapps.config_model_utils.models import StackedConfigurationModel
from openedx.features.content_type_gating.helpers import correct_modes_for_fbe, enrollment_date_for_fbe
Expand All @@ -31,14 +31,15 @@ class ContentTypeGatingConfig(StackedConfigurationModel):
'created after this date and time (user local time) will be affected.'
)
)
studio_override_enabled = models.NullBooleanField(
studio_override_enabled = models.BooleanField(
default=None,
verbose_name=_('Studio Override Enabled'),
blank=True,
help_text=_(
'Allow Feature Based Enrollment visibility to be overriden '
'on a per-component basis in Studio.'
)
),
null=True
)

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion openedx/features/content_type_gating/partitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import crum
import pytz
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from web_fragments.fragment import Fragment

from common.djangoapps.course_modes.models import CourseMode
Expand Down
2 changes: 1 addition & 1 deletion openedx/features/course_bookmarks/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


from django.urls import reverse
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

from lms.djangoapps.courseware.permissions import EDIT_BOOKMARK
from openedx.features.course_experience.course_tools import CourseTool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from django.template.loader import render_to_string
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.cache import cache_control
from django.views.decorators.csrf import ensure_csrf_cookie
from django.views.generic import View
Expand Down
2 changes: 1 addition & 1 deletion openedx/features/course_duration_limits/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

from django.utils import timezone
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from edx_django_utils.cache import RequestCache
from web_fragments.fragment import Fragment

Expand Down
2 changes: 1 addition & 1 deletion openedx/features/course_duration_limits/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.db import models
from django.utils import timezone

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from openedx.core.djangoapps.config_model_utils.models import StackedConfigurationModel
from openedx.features.content_type_gating.helpers import correct_modes_for_fbe, enrollment_date_for_fbe
Expand Down
2 changes: 1 addition & 1 deletion openedx/features/course_experience/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Unified course experience settings and helper methods.
"""
import crum
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from edx_django_utils.monitoring import set_custom_attribute
from waffle import flag_is_active # lint-amnesty, pylint: disable=invalid-django-waffle-import

Expand Down
2 changes: 1 addition & 1 deletion openedx/features/course_experience/api/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.conf import settings
from django.urls import reverse
from django.utils.html import format_html
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from eventtracking import tracker

from rest_framework.decorators import api_view, authentication_classes, permission_classes
Expand Down
2 changes: 1 addition & 1 deletion openedx/features/course_experience/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.urls import reverse
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

from common.djangoapps.student.models import CourseEnrollment
from openedx.core.lib.courses import get_course_by_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

from datetime import datetime, timedelta
from unittest import mock
from urllib.parse import quote_plus

import ddt
from django.conf import settings
from django.http import QueryDict
from django.test.utils import override_settings
from django.urls import reverse
from django.utils.http import urlquote_plus
from django.utils.timezone import now
from edx_toggles.toggles.testutils import override_waffle_flag
from pytz import UTC
Expand Down Expand Up @@ -371,7 +371,7 @@ def test_sign_in_button(self):
"""
url = course_home_url(self.course)
response = self.client.get(url)
self.assertContains(response, f'/login?next={urlquote_plus(url)}')
self.assertContains(response, f'/login?next={quote_plus(url)}')

@mock.patch.dict(settings.FEATURES, {'DISABLE_START_DATES': False})
def test_non_live_course(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@


from datetime import datetime
from urllib.parse import quote_plus

from babel.dates import format_date, format_timedelta
from django.conf import settings
from django.contrib import auth
from django.template.loader import render_to_string
from django.utils.http import urlquote_plus
from django.utils.translation import get_language, to_locale
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from opaque_keys.edx.keys import CourseKey
from pytz import UTC
from web_fragments.fragment import Fragment
Expand Down Expand Up @@ -123,11 +123,11 @@ def _register_course_home_messages(request, course, user_access, course_start_da
Text(sign_in_or_register_text).format(
sign_in_link=HTML('<a href="/login?next={current_url}">{sign_in_label}</a>').format(
sign_in_label=_('Sign in'),
current_url=urlquote_plus(request.path),
current_url=quote_plus(request.path),
),
register_link=HTML('<a href="/register?next={current_url}">{register_label}</a>').format(
register_label=_('register'),
current_url=urlquote_plus(request.path),
current_url=quote_plus(request.path),
)
),
title=Text(_('You must be enrolled in the course to see course content.'))
Expand Down
2 changes: 1 addition & 1 deletion openedx/features/discounts/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from openedx.core.djangoapps.config_model_utils.admin import StackedConfigModelAdmin

Expand Down
2 changes: 1 addition & 1 deletion openedx/features/discounts/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Migration(migrations.Migration):
('enabled', models.NullBooleanField(default=None, 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')),
('disabled', models.BooleanField(default=None, verbose_name='Disabled', null=True)),
('changed_by', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='Changed by')),
('course', models.ForeignKey(blank=True, help_text='Configure values for this course run. This should be formatted as the CourseKey (i.e. course-v1://MITx+6.002x+2019_Q1)', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='course_overviews.CourseOverview', verbose_name='Course Run')),
('site', models.ForeignKey(blank=True, help_text='Configure values for all course runs associated with this site.', null=True, on_delete=django.db.models.deletion.CASCADE, to='sites.Site')),
Expand Down
4 changes: 2 additions & 2 deletions openedx/features/discounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 openedx.core.djangoapps.config_model_utils.models import StackedConfigurationModel

Expand All @@ -20,7 +20,7 @@ class DiscountRestrictionConfig(StackedConfigurationModel):
STACKABLE_FIELDS = ('disabled',)
# Since this config disables a feature, it seemed it would be clearer to use a disabled flag instead of enabled.
# The enabled field still exists but is not used or shown in the admin.
disabled = models.NullBooleanField(default=None, verbose_name=_("Disabled"))
disabled = models.BooleanField(default=None, verbose_name=_("Disabled"), null=True)

@classmethod
def disabled_for_course_stacked_config(cls, course):
Expand Down
2 changes: 1 addition & 1 deletion openedx/features/discounts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import pytz
from django.utils.translation import get_language
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

from common.djangoapps.course_modes.models import format_course_price, get_course_prices
from lms.djangoapps.experiments.models import ExperimentData
Expand Down
2 changes: 1 addition & 1 deletion openedx/features/enterprise_support/admin/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

from django import forms
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from enterprise.admin.utils import validate_csv


Expand Down
2 changes: 1 addition & 1 deletion openedx/features/enterprise_support/admin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from django.contrib import messages
from django.urls import reverse
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django.views.generic.edit import FormView
from enterprise.models import EnterpriseCourseEnrollment

Expand Down
2 changes: 1 addition & 1 deletion openedx/features/enterprise_support/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from django.template.loader import render_to_string
from django.urls import reverse
from django.utils.http import urlencode
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from edx_django_utils.cache import TieredCache, get_cache_key
from edx_rest_api_client.client import EdxRestApiClient
from slumber.exceptions import HttpClientError, HttpNotFoundError, HttpServerError
Expand Down
2 changes: 1 addition & 1 deletion openedx/features/enterprise_support/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from django.core.cache import cache
from django.http import HttpRequest
from django.urls import NoReverseMatch, reverse
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from edx_django_utils.cache import TieredCache, get_cache_key
from edx_toggles.toggles import LegacyWaffleFlag
from enterprise.api.v1.serializers import EnterpriseCustomerBrandingConfigurationSerializer
Expand Down
4 changes: 2 additions & 2 deletions openedx/features/lti_course_tab/tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.sites.shortcuts import get_current_site
from django.http import HttpRequest
from django.utils.translation import get_language, to_locale, ugettext_lazy
from django.utils.translation import get_language, to_locale, gettext_lazy
from lti_consumer.api import get_lti_pii_sharing_state_for_course
from lti_consumer.lti_1p1.contrib.django import lti_embed
from lti_consumer.models import LtiConfiguration
Expand Down Expand Up @@ -268,7 +268,7 @@ class DiscussionLtiCourseTab(LtiCourseLaunchMixin, TabFragmentViewMixin, Enrolle
type = 'lti_discussion'
allow_multiple = False
is_dynamic = True
title = ugettext_lazy("Discussion")
title = gettext_lazy("Discussion")

def _get_lti_config(self, course: CourseBlock) -> LtiConfiguration:
config = DiscussionsConfiguration.get(course.id)
Expand Down