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 lms/djangoapps/course_home_api/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')),
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/ace_common/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/api_admin/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/api_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.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
Expand Down
4 changes: 2 additions & 2 deletions openedx/core/djangoapps/api_admin/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions openedx/core/djangoapps/api_admin/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions openedx/core/djangoapps/auth_exchange/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
"""
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/bookmarks/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions openedx/core/djangoapps/bookmarks/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down Expand Up @@ -217,27 +217,27 @@ def post(self, request, *unused_args, **unused_kwargs): # lint-amnesty, pylint:
Request data: {"usage_id": <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)
Expand Down Expand Up @@ -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)

Expand All @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/catalog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/config_model_utils/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions openedx/core/djangoapps/config_model_utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
),
]
4 changes: 2 additions & 2 deletions openedx/core/djangoapps/content/course_overviews/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/content_libraries/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/cors_csrf/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion openedx/core/djangoapps/course_apps/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Original file line number Diff line number Diff line change
Expand Up @@ -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')),
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/course_groups/cohorts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion openedx/core/djangoapps/course_groups/signals/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 2 additions & 2 deletions openedx/core/djangoapps/course_groups/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/courseware_api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/credentials/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/credentials/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/credit/email_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/credit/exceptions.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Loading