Merge pull request #29570 from edx/jawayria/fix-url-common
fix: fixed RemovedInDjango40 warnings in common
This commit is contained in:
@@ -3,10 +3,11 @@ URL definitions for the course_modes API.
|
||||
"""
|
||||
|
||||
|
||||
from django.conf.urls import include, url
|
||||
from django.conf.urls import include
|
||||
from django.urls import path
|
||||
|
||||
app_name = 'common.djangoapps.course_modes.rest_api'
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^v1/', include('common.djangoapps.course_modes.rest_api.v1.urls', namespace='v1')),
|
||||
path('v1/', include('common.djangoapps.course_modes.rest_api.v1.urls', namespace='v1')),
|
||||
]
|
||||
|
||||
@@ -4,19 +4,19 @@ URL definitions for the course_modes v1 API.
|
||||
|
||||
|
||||
from django.conf import settings
|
||||
from django.conf.urls import url
|
||||
|
||||
from common.djangoapps.course_modes.rest_api.v1 import views
|
||||
from django.urls import re_path
|
||||
|
||||
app_name = 'v1'
|
||||
|
||||
urlpatterns = [
|
||||
url(
|
||||
re_path(
|
||||
fr'^courses/{settings.COURSE_ID_PATTERN}/$',
|
||||
views.CourseModesView.as_view(),
|
||||
name='course_modes_list'
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
fr'^courses/{settings.COURSE_ID_PATTERN}/(?P<mode_slug>.*)$',
|
||||
views.CourseModesDetailView.as_view(),
|
||||
name='course_modes_detail'
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
|
||||
|
||||
from django.conf import settings
|
||||
from django.conf.urls import url
|
||||
|
||||
from common.djangoapps.course_modes import views
|
||||
from django.urls import re_path
|
||||
|
||||
urlpatterns = [
|
||||
url(fr'^choose/{settings.COURSE_ID_PATTERN}/$', views.ChooseModeView.as_view(), name='course_modes_choose'),
|
||||
re_path(fr'^choose/{settings.COURSE_ID_PATTERN}/$', views.ChooseModeView.as_view(), name='course_modes_choose'),
|
||||
]
|
||||
|
||||
# Enable verified mode creation
|
||||
if settings.FEATURES.get('MODE_CREATION_FOR_TESTING'):
|
||||
urlpatterns.append(
|
||||
url(fr'^create_mode/{settings.COURSE_ID_PATTERN}/$',
|
||||
views.create_mode,
|
||||
name='create_mode'),
|
||||
re_path(fr'^create_mode/{settings.COURSE_ID_PATTERN}/$',
|
||||
views.create_mode,
|
||||
name='create_mode'),
|
||||
)
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
URLs file for the Entitlements API.
|
||||
"""
|
||||
|
||||
from django.conf.urls import include, url
|
||||
from django.conf.urls import include
|
||||
from django.urls import path
|
||||
|
||||
app_name = 'entitlements'
|
||||
urlpatterns = [
|
||||
url(r'^v1/', include('common.djangoapps.entitlements.rest_api.v1.urls')),
|
||||
path('v1/', include('common.djangoapps.entitlements.rest_api.v1.urls')),
|
||||
]
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
URLs for the V1 of the Entitlements API.
|
||||
"""
|
||||
|
||||
from django.conf.urls import include, url
|
||||
from django.conf.urls import include
|
||||
from rest_framework.routers import DefaultRouter
|
||||
|
||||
from .views import EntitlementEnrollmentViewSet, EntitlementViewSet
|
||||
from django.urls import path, re_path
|
||||
|
||||
router = DefaultRouter()
|
||||
router.register(r'entitlements', EntitlementViewSet, basename='entitlements')
|
||||
@@ -17,8 +18,8 @@ ENROLLMENTS_VIEW = EntitlementEnrollmentViewSet.as_view({
|
||||
|
||||
app_name = 'v1'
|
||||
urlpatterns = [
|
||||
url(r'', include(router.urls)),
|
||||
url(
|
||||
path('', include(router.urls)),
|
||||
re_path(
|
||||
fr'entitlements/(?P<uuid>{EntitlementViewSet.ENTITLEMENT_UUID4_REGEX})/enrollments$',
|
||||
ENROLLMENTS_VIEW,
|
||||
name='enrollments'
|
||||
|
||||
@@ -4,26 +4,26 @@ URLs for student app
|
||||
|
||||
|
||||
from django.conf import settings
|
||||
from django.conf.urls import url
|
||||
|
||||
from . import views
|
||||
from django.urls import path, re_path
|
||||
|
||||
urlpatterns = [
|
||||
|
||||
url(r'^email_confirm/(?P<key>[^/]*)$', views.confirm_email_change, name='confirm_email_change'),
|
||||
re_path(r'^email_confirm/(?P<key>[^/]*)$', views.confirm_email_change, name='confirm_email_change'),
|
||||
|
||||
url(r'^activate/(?P<key>[^/]*)$', views.activate_account, name="activate"),
|
||||
re_path(r'^activate/(?P<key>[^/]*)$', views.activate_account, name="activate"),
|
||||
|
||||
url(r'^accounts/disable_account_ajax$', views.disable_account_ajax, name="disable_account_ajax"),
|
||||
url(r'^accounts/manage_user_standing', views.manage_user_standing, name='manage_user_standing'),
|
||||
path('accounts/disable_account_ajax', views.disable_account_ajax, name="disable_account_ajax"),
|
||||
path('accounts/manage_user_standing', views.manage_user_standing, name='manage_user_standing'),
|
||||
|
||||
url(r'^change_email_settings$', views.change_email_settings, name='change_email_settings'),
|
||||
path('change_email_settings', views.change_email_settings, name='change_email_settings'),
|
||||
|
||||
url(fr'^course_run/{settings.COURSE_ID_PATTERN}/refund_status$',
|
||||
views.course_run_refund_status,
|
||||
name="course_run_refund_status"),
|
||||
re_path(fr'^course_run/{settings.COURSE_ID_PATTERN}/refund_status$',
|
||||
views.course_run_refund_status,
|
||||
name="course_run_refund_status"),
|
||||
|
||||
url(
|
||||
re_path(
|
||||
r'^activate_secondary_email/(?P<key>[^/]*)$',
|
||||
views.activate_secondary_email,
|
||||
name='activate_secondary_email'
|
||||
|
||||
@@ -2,27 +2,26 @@
|
||||
|
||||
|
||||
from django.conf import settings
|
||||
from django.conf.urls import url
|
||||
|
||||
from .views import ThirdPartyAuthUserStatusView, UserMappingView, UserView, UserViewV2
|
||||
from django.urls import path, re_path
|
||||
|
||||
PROVIDER_PATTERN = r'(?P<provider_id>[\w.+-]+)(?:\:(?P<idp_slug>[\w.+-]+))?'
|
||||
|
||||
urlpatterns = [
|
||||
url(
|
||||
re_path(
|
||||
fr'^v0/users/{settings.USERNAME_PATTERN}$',
|
||||
UserView.as_view(),
|
||||
name='third_party_auth_users_api',
|
||||
),
|
||||
url(r'^v0/users/', UserViewV2.as_view(), name='third_party_auth_users_api_v2'),
|
||||
url(
|
||||
path('v0/users/', UserViewV2.as_view(), name='third_party_auth_users_api_v2'),
|
||||
re_path(
|
||||
fr'^v0/providers/{PROVIDER_PATTERN}/users$',
|
||||
UserMappingView.as_view(),
|
||||
name='third_party_auth_user_mapping_api',
|
||||
),
|
||||
url(
|
||||
r'^v0/providers/user_status$',
|
||||
ThirdPartyAuthUserStatusView.as_view(),
|
||||
path(
|
||||
'v0/providers/user_status', ThirdPartyAuthUserStatusView.as_view(),
|
||||
name='third_party_auth_user_status_api',
|
||||
),
|
||||
]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Url configuration for the auth module."""
|
||||
|
||||
from django.conf.urls import include, url
|
||||
from django.conf.urls import include
|
||||
|
||||
from .views import (
|
||||
IdPRedirectView,
|
||||
@@ -9,15 +9,16 @@ from .views import (
|
||||
post_to_custom_auth_form,
|
||||
saml_metadata_view
|
||||
)
|
||||
from django.urls import path, re_path
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^auth/inactive', inactive_user_view, name="third_party_inactive_redirect"),
|
||||
url(r'^auth/custom_auth_entry', post_to_custom_auth_form, name='tpa_post_to_custom_auth_form'),
|
||||
url(r'^auth/saml/metadata.xml', saml_metadata_view),
|
||||
url(r'^auth/login/(?P<backend>lti)/$', lti_login_and_complete_view),
|
||||
url(r'^auth/idp_redirect/(?P<provider_slug>[\w-]+)', IdPRedirectView.as_view(), name="idp_redirect"),
|
||||
url(r'^auth/', include('social_django.urls', namespace='social')),
|
||||
url(r'^auth/saml/v0/', include('common.djangoapps.third_party_auth.samlproviderconfig.urls')),
|
||||
url(r'^auth/saml/v0/', include('common.djangoapps.third_party_auth.samlproviderdata.urls')),
|
||||
url(r'^auth/saml/v0/', include('common.djangoapps.third_party_auth.saml_configuration.urls')),
|
||||
path('auth/inactive', inactive_user_view, name="third_party_inactive_redirect"),
|
||||
path('auth/custom_auth_entry', post_to_custom_auth_form, name='tpa_post_to_custom_auth_form'),
|
||||
re_path(r'^auth/saml/metadata.xml', saml_metadata_view),
|
||||
re_path(r'^auth/login/(?P<backend>lti)/$', lti_login_and_complete_view),
|
||||
path('auth/idp_redirect/<slug:provider_slug>', IdPRedirectView.as_view(), name="idp_redirect"),
|
||||
path('auth/', include('social_django.urls', namespace='social')),
|
||||
path('auth/saml/v0/', include('common.djangoapps.third_party_auth.samlproviderconfig.urls')),
|
||||
path('auth/saml/v0/', include('common.djangoapps.third_party_auth.samlproviderdata.urls')),
|
||||
path('auth/saml/v0/', include('common.djangoapps.third_party_auth.saml_configuration.urls')),
|
||||
]
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
"""
|
||||
URLs for track app
|
||||
"""
|
||||
from django.conf.urls import url
|
||||
|
||||
from . import views
|
||||
from .views import segmentio
|
||||
from django.urls import path
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^event$', views.user_track),
|
||||
url(r'^segmentio/event$', segmentio.segmentio_event),
|
||||
path('event', views.user_track),
|
||||
path('segmentio/event', segmentio.segmentio_event),
|
||||
]
|
||||
|
||||
@@ -7,7 +7,7 @@ import re
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import crum
|
||||
from django.utils.translation import get_language, pgettext, gettext
|
||||
from django.utils.translation import get_language, gettext, pgettext
|
||||
from pytz import UnknownTimeZoneError, timezone, utc
|
||||
|
||||
from lms.djangoapps.courseware.context_processor import user_timezone_locale_prefs
|
||||
|
||||
@@ -8,13 +8,13 @@ import logging
|
||||
|
||||
from codejail.safe_exec import SafeExecException
|
||||
from django.conf import settings
|
||||
from django.utils.translation import ugettext as _
|
||||
from edx_toggles.toggles import SettingToggle
|
||||
from importlib import import_module
|
||||
from requests.exceptions import RequestException, HTTPError
|
||||
from simplejson import JSONDecodeError
|
||||
|
||||
from .exceptions import CodejailServiceParseError, CodejailServiceStatusError, CodejailServiceUnavailable
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user