fix: fixed django40 warnings (#29655)
* fix: fixed django40 warnings * fix: fix quality failures Co-authored-by: UsamaSadiq <usama.sadiq@arbisoft.com>
This commit is contained in:
committed by
GitHub
parent
193efadd30
commit
4260bd2af5
@@ -3,12 +3,12 @@ URLs for the Agreements API
|
||||
"""
|
||||
|
||||
from django.conf import settings
|
||||
from django.conf.urls import url
|
||||
from django.urls import re_path
|
||||
|
||||
from .views import IntegritySignatureView
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^integrity_signature/{course_id}$'.format(
|
||||
re_path(r'^integrity_signature/{course_id}$'.format(
|
||||
course_id=settings.COURSE_ID_PATTERN
|
||||
), IntegritySignatureView.as_view(), name='integrity_signature'),
|
||||
]
|
||||
|
||||
@@ -3,9 +3,10 @@ URL definitions for api access request API.
|
||||
"""
|
||||
|
||||
|
||||
from django.conf.urls import include, url
|
||||
from django.conf.urls import include
|
||||
from django.urls import path
|
||||
|
||||
app_name = 'api_admin'
|
||||
urlpatterns = [
|
||||
url(r'^v1/', include('openedx.core.djangoapps.api_admin.api.v1.urls')),
|
||||
path('v1/', include('openedx.core.djangoapps.api_admin.api.v1.urls')),
|
||||
]
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
URL definitions for api access request API v1.
|
||||
"""
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from django.urls import path
|
||||
from openedx.core.djangoapps.api_admin.api.v1 import views
|
||||
|
||||
app_name = 'v1'
|
||||
urlpatterns = [
|
||||
url(r'^api_access_request/$', views.ApiAccessRequestView.as_view(), name='list_api_access_request'),
|
||||
path('api_access_request/', views.ApiAccessRequestView.as_view(), name='list_api_access_request'),
|
||||
]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
"""URLs for API access management."""
|
||||
|
||||
|
||||
from django.conf.urls import include, url
|
||||
from django.contrib.admin.views.decorators import staff_member_required
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.urls import include, path, re_path
|
||||
|
||||
from openedx.core.djangoapps.api_admin.decorators import api_access_enabled_or_404
|
||||
from openedx.core.djangoapps.api_admin.views import (
|
||||
@@ -18,26 +18,20 @@ from openedx.core.djangoapps.api_admin.views import (
|
||||
|
||||
app_name = 'api_admin'
|
||||
urlpatterns = (
|
||||
url(
|
||||
r'^status/$',
|
||||
api_access_enabled_or_404(login_required(ApiRequestStatusView.as_view())),
|
||||
name="api-status"
|
||||
path('status/', api_access_enabled_or_404(login_required(ApiRequestStatusView.as_view())),
|
||||
name="api-status"
|
||||
),
|
||||
path('terms-of-service/', api_access_enabled_or_404(ApiTosView.as_view()),
|
||||
name="api-tos"
|
||||
),
|
||||
path('catalogs/preview/', staff_member_required(
|
||||
api_access_enabled_or_404(CatalogPreviewView.as_view()),
|
||||
login_url='dashboard',
|
||||
redirect_field_name=None
|
||||
),
|
||||
url(
|
||||
r'^terms-of-service/$',
|
||||
api_access_enabled_or_404(ApiTosView.as_view()),
|
||||
name="api-tos"
|
||||
),
|
||||
url(
|
||||
r'^catalogs/preview/$',
|
||||
staff_member_required(
|
||||
api_access_enabled_or_404(CatalogPreviewView.as_view()),
|
||||
login_url='dashboard',
|
||||
redirect_field_name=None
|
||||
),
|
||||
name='catalog-preview',
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r'^catalogs/user/(?P<username>[\w.@+-]+)/$',
|
||||
staff_member_required(
|
||||
api_access_enabled_or_404(CatalogListView.as_view()),
|
||||
@@ -46,30 +40,23 @@ urlpatterns = (
|
||||
),
|
||||
name='catalog-list',
|
||||
),
|
||||
url(
|
||||
r'^catalogs/(?P<catalog_id>\d+)/$',
|
||||
staff_member_required(
|
||||
api_access_enabled_or_404(CatalogEditView.as_view()),
|
||||
login_url='dashboard',
|
||||
redirect_field_name=None
|
||||
),
|
||||
path('catalogs/<int:catalog_id>/', staff_member_required(
|
||||
api_access_enabled_or_404(CatalogEditView.as_view()),
|
||||
login_url='dashboard',
|
||||
redirect_field_name=None
|
||||
),
|
||||
name='catalog-edit',
|
||||
),
|
||||
url(
|
||||
r'^catalogs/$',
|
||||
staff_member_required(
|
||||
api_access_enabled_or_404(CatalogSearchView.as_view()),
|
||||
login_url='dashboard',
|
||||
redirect_field_name=None
|
||||
),
|
||||
path('catalogs/', staff_member_required(
|
||||
api_access_enabled_or_404(CatalogSearchView.as_view()),
|
||||
login_url='dashboard',
|
||||
redirect_field_name=None
|
||||
),
|
||||
name='catalog-search',
|
||||
),
|
||||
url(
|
||||
r'^$',
|
||||
api_access_enabled_or_404(login_required(ApiRequestView.as_view())),
|
||||
name="api-request"
|
||||
),
|
||||
url(
|
||||
r'^api/', include('openedx.core.djangoapps.api_admin.api.urls', namespace='api'),
|
||||
),
|
||||
path('', api_access_enabled_or_404(login_required(ApiRequestView.as_view())),
|
||||
name="api-request"
|
||||
),
|
||||
path('api/', include('openedx.core.djangoapps.api_admin.api.urls', namespace='api'),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -4,17 +4,15 @@ URL routes for the bookmarks app.
|
||||
|
||||
|
||||
from django.conf import settings
|
||||
from django.conf.urls import url
|
||||
from django.urls import path, re_path
|
||||
|
||||
from .views import BookmarksDetailView, BookmarksListView
|
||||
|
||||
urlpatterns = [
|
||||
url(
|
||||
r'^v1/bookmarks/$',
|
||||
BookmarksListView.as_view(),
|
||||
name='bookmarks'
|
||||
),
|
||||
url(
|
||||
path('v1/bookmarks/', BookmarksListView.as_view(),
|
||||
name='bookmarks'
|
||||
),
|
||||
re_path(
|
||||
r'^v1/bookmarks/{username},{usage_key}/$'.format(
|
||||
username=settings.USERNAME_PATTERN,
|
||||
usage_key=settings.USAGE_ID_PATTERN
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
Defines the URL routes for this app.
|
||||
"""
|
||||
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from django.urls import path
|
||||
from . import views
|
||||
|
||||
app_name = 'catalog'
|
||||
urlpatterns = [
|
||||
url(r'^management/cache_programs/$', views.cache_programs, name='cache_programs'),
|
||||
path('management/cache_programs/', views.cache_programs, name='cache_programs'),
|
||||
]
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
# lint-amnesty, pylint: disable=missing-module-docstring
|
||||
from django.conf.urls import url
|
||||
|
||||
from django.urls import path
|
||||
from .views import CourseOutlineView
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
url(
|
||||
r'^v1/course_outline/(?P<course_key_str>.+)$',
|
||||
CourseOutlineView.as_view(),
|
||||
name='course_outline',
|
||||
)
|
||||
path('v1/course_outline/<path:course_key_str>', CourseOutlineView.as_view(),
|
||||
name='course_outline',
|
||||
)
|
||||
]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
URL configuration for Studio's Content Libraries REST API
|
||||
"""
|
||||
|
||||
from django.conf.urls import include, url
|
||||
from django.urls import include, path, re_path
|
||||
|
||||
from rest_framework import routers
|
||||
|
||||
@@ -23,48 +23,48 @@ import_blocks_router.register(r'tasks', views.LibraryImportTaskViewSet, basename
|
||||
# standard XBlock REST API (see openedx.core.django_apps.xblock.rest_api.urls)
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^api/libraries/v2/', include([
|
||||
path('api/libraries/v2/', include([
|
||||
# list of libraries / create a library:
|
||||
url(r'^$', views.LibraryRootView.as_view()),
|
||||
url(r'^(?P<lib_key_str>[^/]+)/', include([
|
||||
path('', views.LibraryRootView.as_view()),
|
||||
path('<str:lib_key_str>/', include([
|
||||
# get data about a library, update a library, or delete a library:
|
||||
url(r'^$', views.LibraryDetailsView.as_view()),
|
||||
path('', views.LibraryDetailsView.as_view()),
|
||||
# Get the list of XBlock types that can be added to this library
|
||||
url(r'^block_types/$', views.LibraryBlockTypesView.as_view()),
|
||||
path('block_types/', views.LibraryBlockTypesView.as_view()),
|
||||
# Get the list of Blockstore Bundle Links for this library, or add a new one:
|
||||
url(r'^links/$', views.LibraryLinksView.as_view()),
|
||||
path('links/', views.LibraryLinksView.as_view()),
|
||||
# Update or delete a link:
|
||||
url(r'^links/(?P<link_id>[^/]+)/$', views.LibraryLinkDetailView.as_view()),
|
||||
path('links/<str:link_id>/', views.LibraryLinkDetailView.as_view()),
|
||||
# Get the list of XBlocks in this library, or add a new one:
|
||||
url(r'^blocks/$', views.LibraryBlocksView.as_view()),
|
||||
path('blocks/', views.LibraryBlocksView.as_view()),
|
||||
# Commit (POST) or revert (DELETE) all pending changes to this library:
|
||||
url(r'^commit/$', views.LibraryCommitView.as_view()),
|
||||
path('commit/', views.LibraryCommitView.as_view()),
|
||||
# Get the list of users/groups who have permission to view/edit/administer this library:
|
||||
url(r'^team/$', views.LibraryTeamView.as_view()),
|
||||
path('team/', views.LibraryTeamView.as_view()),
|
||||
# Add/Edit (PUT) or remove (DELETE) a user's permission to use this library
|
||||
url(r'^team/user/(?P<username>[^/]+)/$', views.LibraryTeamUserView.as_view()),
|
||||
path('team/user/<str:username>/', views.LibraryTeamUserView.as_view()),
|
||||
# Add/Edit (PUT) or remove (DELETE) a group's permission to use this library
|
||||
url(r'^team/group/(?P<group_name>[^/]+)/$', views.LibraryTeamGroupView.as_view()),
|
||||
path('team/group/<str:group_name>/', views.LibraryTeamGroupView.as_view()),
|
||||
# Import blocks into this library.
|
||||
url(r'^import_blocks/', include(import_blocks_router.urls)),
|
||||
path('import_blocks/', include(import_blocks_router.urls)),
|
||||
])),
|
||||
url(r'^blocks/(?P<usage_key_str>[^/]+)/', include([
|
||||
path('blocks/<str:usage_key_str>/', include([
|
||||
# Get metadata about a specific XBlock in this library, or delete the block:
|
||||
url(r'^$', views.LibraryBlockView.as_view()),
|
||||
path('', views.LibraryBlockView.as_view()),
|
||||
# Get the LTI URL of a specific XBlock
|
||||
url(r'^lti/$', views.LibraryBlockLtiUrlView.as_view(), name='lti-url'),
|
||||
path('lti/', views.LibraryBlockLtiUrlView.as_view(), name='lti-url'),
|
||||
# Get the OLX source code of the specified block:
|
||||
url(r'^olx/$', views.LibraryBlockOlxView.as_view()),
|
||||
path('olx/', views.LibraryBlockOlxView.as_view()),
|
||||
# CRUD for static asset files associated with a block in the library:
|
||||
url(r'^assets/$', views.LibraryBlockAssetListView.as_view()),
|
||||
url(r'^assets/(?P<file_path>.+)$', views.LibraryBlockAssetView.as_view()),
|
||||
path('assets/', views.LibraryBlockAssetListView.as_view()),
|
||||
path('assets/<path:file_path>', views.LibraryBlockAssetView.as_view()),
|
||||
# Future: publish/discard changes for just this one block
|
||||
# Future: set a block's tags (tags are stored in a Tag bundle and linked in)
|
||||
])),
|
||||
url(r'^lti/1.3/', include([
|
||||
url(r'^login/$', views.LtiToolLoginView.as_view(), name='lti-login'),
|
||||
url(r'^launch/$', views.LtiToolLaunchView.as_view(), name='lti-launch'),
|
||||
url(r'^pub/jwks/$', views.LtiToolJwksView.as_view(), name='lti-pub-jwks'),
|
||||
re_path(r'^lti/1.3/', include([
|
||||
path('login/', views.LtiToolLoginView.as_view(), name='lti-login'),
|
||||
path('launch/', views.LtiToolLaunchView.as_view(), name='lti-launch'),
|
||||
path('pub/jwks/', views.LtiToolJwksView.as_view(), name='lti-pub-jwks'),
|
||||
])),
|
||||
])),
|
||||
]
|
||||
|
||||
@@ -4,34 +4,34 @@ Cohort API URLs
|
||||
|
||||
|
||||
from django.conf import settings
|
||||
from django.conf.urls import url
|
||||
from django.urls import re_path
|
||||
|
||||
import lms.djangoapps.instructor.views.api
|
||||
import openedx.core.djangoapps.course_groups.views
|
||||
|
||||
urlpatterns = [
|
||||
url(
|
||||
re_path(
|
||||
r'^v1/settings/{}$'.format(
|
||||
settings.COURSE_KEY_PATTERN,
|
||||
),
|
||||
openedx.core.djangoapps.course_groups.views.CohortSettings.as_view(),
|
||||
name='cohort_settings',
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r'^v1/courses/{}/cohorts/(?P<cohort_id>[0-9]+)?$'.format(
|
||||
settings.COURSE_KEY_PATTERN,
|
||||
),
|
||||
openedx.core.djangoapps.course_groups.views.CohortHandler.as_view(),
|
||||
name='cohort_handler',
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r'^v1/courses/{}/cohorts/(?P<cohort_id>[0-9]+)/users/(?P<username>.+)?$'.format(
|
||||
settings.COURSE_KEY_PATTERN,
|
||||
),
|
||||
openedx.core.djangoapps.course_groups.views.CohortUsers.as_view(),
|
||||
name='cohort_users',
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r'^v1/courses/{}/users?$'.format(
|
||||
settings.COURSE_KEY_PATTERN,
|
||||
),
|
||||
|
||||
@@ -4,29 +4,27 @@ Contains all the URLs
|
||||
|
||||
|
||||
from django.conf import settings
|
||||
from django.conf.urls import url
|
||||
from django.urls import path, re_path
|
||||
|
||||
from openedx.core.djangoapps.courseware_api import views
|
||||
|
||||
urlpatterns = [
|
||||
url(fr'^course/{settings.COURSE_KEY_PATTERN}',
|
||||
views.CoursewareInformation.as_view(),
|
||||
name="courseware-api"),
|
||||
url(fr'^sequence/{settings.USAGE_KEY_PATTERN}',
|
||||
views.SequenceMetadata.as_view(),
|
||||
name="sequence-api"),
|
||||
url(fr'^resume/{settings.COURSE_KEY_PATTERN}',
|
||||
views.Resume.as_view(),
|
||||
name="resume-api"),
|
||||
url(fr'^celebration/{settings.COURSE_KEY_PATTERN}',
|
||||
views.Celebration.as_view(),
|
||||
name="celebration-api"),
|
||||
re_path(fr'^course/{settings.COURSE_KEY_PATTERN}',
|
||||
views.CoursewareInformation.as_view(),
|
||||
name="courseware-api"),
|
||||
re_path(fr'^sequence/{settings.USAGE_KEY_PATTERN}',
|
||||
views.SequenceMetadata.as_view(),
|
||||
name="sequence-api"),
|
||||
re_path(fr'^resume/{settings.COURSE_KEY_PATTERN}',
|
||||
views.Resume.as_view(),
|
||||
name="resume-api"),
|
||||
re_path(fr'^celebration/{settings.COURSE_KEY_PATTERN}',
|
||||
views.Celebration.as_view(),
|
||||
name="celebration-api"),
|
||||
]
|
||||
|
||||
if getattr(settings, 'PROVIDER_STATES_URL', None):
|
||||
from .tests.pacts.views import provider_state
|
||||
urlpatterns.append(url(
|
||||
r'^pact/provider_states/$',
|
||||
provider_state,
|
||||
name='provider-state-view'
|
||||
))
|
||||
urlpatterns.append(path('pact/provider_states/', provider_state,
|
||||
name='provider-state-view'
|
||||
))
|
||||
|
||||
@@ -3,20 +3,20 @@ URLs for the credit app.
|
||||
"""
|
||||
|
||||
|
||||
from django.conf.urls import include, url
|
||||
from django.urls import include, path, re_path
|
||||
|
||||
from openedx.core.djangoapps.credit import models, routers, views
|
||||
|
||||
PROVIDER_ID_PATTERN = fr'(?P<provider_id>{models.CREDIT_PROVIDER_ID_REGEX})'
|
||||
|
||||
PROVIDER_URLS = [
|
||||
url(r'^request/$', views.CreditProviderRequestCreateView.as_view(), name='create_request'),
|
||||
url(r'^callback/?$', views.CreditProviderCallbackView.as_view(), name='provider_callback'),
|
||||
path('request/', views.CreditProviderRequestCreateView.as_view(), name='create_request'),
|
||||
re_path(r'^callback/?$', views.CreditProviderCallbackView.as_view(), name='provider_callback'),
|
||||
]
|
||||
|
||||
V1_URLS = [
|
||||
url(fr'^providers/{PROVIDER_ID_PATTERN}/', include(PROVIDER_URLS)),
|
||||
url(r'^eligibility/$', views.CreditEligibilityView.as_view(), name='eligibility_details'),
|
||||
re_path(fr'^providers/{PROVIDER_ID_PATTERN}/', include(PROVIDER_URLS)),
|
||||
path('eligibility/', views.CreditEligibilityView.as_view(), name='eligibility_details'),
|
||||
]
|
||||
|
||||
router = routers.SimpleRouter() # pylint: disable=invalid-name
|
||||
@@ -26,5 +26,5 @@ V1_URLS += router.urls
|
||||
|
||||
app_name = 'credit'
|
||||
urlpatterns = [
|
||||
url(r'^v1/', include(V1_URLS)),
|
||||
path('v1/', include(V1_URLS)),
|
||||
]
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
Contains all the URLs for the Dark Language Support App
|
||||
"""
|
||||
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from django.urls import path
|
||||
from openedx.core.djangoapps.dark_lang import views
|
||||
|
||||
app_name = 'dark_lang'
|
||||
urlpatterns = [
|
||||
url(r'^$', views.PreviewLanguageFragmentView.as_view(), name='preview_lang'),
|
||||
path('', views.PreviewLanguageFragmentView.as_view(), name='preview_lang'),
|
||||
]
|
||||
|
||||
@@ -2,11 +2,9 @@
|
||||
Urls for verifying health (heartbeat) of the app.
|
||||
"""
|
||||
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from django.urls import path
|
||||
from openedx.core.djangoapps.heartbeat.views import heartbeat
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', heartbeat, name='heartbeat'),
|
||||
path('', heartbeat, name='heartbeat'),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user