From 4dea331486efb800c2ad1217768ca197a9117d27 Mon Sep 17 00:00:00 2001 From: Usama Sadiq Date: Wed, 16 Aug 2023 11:15:17 +0500 Subject: [PATCH] fix: fix django4 deprecation warnings (#32948) --- lms/djangoapps/instructor_task/__init__.py | 1 - .../instructor_task/rest_api/urls.py | 2 +- lms/djangoapps/learner_home/urls.py | 3 ++- .../learner_recommendations/urls.py | 19 ++++++++++--------- lms/djangoapps/ora_staff_grader/urls.py | 2 +- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lms/djangoapps/instructor_task/__init__.py b/lms/djangoapps/instructor_task/__init__.py index 476eeca19152..41903687689c 100644 --- a/lms/djangoapps/instructor_task/__init__.py +++ b/lms/djangoapps/instructor_task/__init__.py @@ -1,2 +1 @@ # lint-amnesty, pylint: disable=missing-module-docstring -default_app_config = 'lms.djangoapps.instructor_task.apps.InstructorTaskConfig' diff --git a/lms/djangoapps/instructor_task/rest_api/urls.py b/lms/djangoapps/instructor_task/rest_api/urls.py index cfffc382b167..6387fe6eb189 100644 --- a/lms/djangoapps/instructor_task/rest_api/urls.py +++ b/lms/djangoapps/instructor_task/rest_api/urls.py @@ -1,7 +1,7 @@ """ Instructor Task Django app root REST API URLs. """ -from django.conf.urls import include +from django.urls import include from django.urls import path from lms.djangoapps.instructor_task.rest_api.v1 import urls as v1_urls diff --git a/lms/djangoapps/learner_home/urls.py b/lms/djangoapps/learner_home/urls.py index b798630b322b..ad7cfef463d1 100644 --- a/lms/djangoapps/learner_home/urls.py +++ b/lms/djangoapps/learner_home/urls.py @@ -2,6 +2,7 @@ Learner Home URL routing configuration """ +from django.urls import path from django.urls import include, re_path from lms.djangoapps.learner_home import views @@ -11,5 +12,5 @@ # Learner Dashboard Routing urlpatterns = [ re_path(r"^init/?", views.InitializeView.as_view(), name="initialize"), - re_path(r"^mock/", include("lms.djangoapps.learner_home.mock.urls")), + path("mock/", include("lms.djangoapps.learner_home.mock.urls")), ] diff --git a/lms/djangoapps/learner_recommendations/urls.py b/lms/djangoapps/learner_recommendations/urls.py index e428616f0d6d..078958455d40 100644 --- a/lms/djangoapps/learner_recommendations/urls.py +++ b/lms/djangoapps/learner_recommendations/urls.py @@ -3,6 +3,7 @@ """ from django.conf import settings +from django.urls import path from django.urls import re_path from lms.djangoapps.learner_recommendations import views @@ -16,16 +17,16 @@ re_path(fr'^cross_product/{settings.COURSE_ID_PATTERN}/$', views.CrossProductRecommendationsView.as_view(), name='cross_product_recommendations'), - re_path(r'^product_recommendations/$', - views.ProductRecommendationsView.as_view(), - name='product_recommendations_amplitude_only'), + path('product_recommendations/', + views.ProductRecommendationsView.as_view(), + name='product_recommendations_amplitude_only'), re_path(fr'^product_recommendations/{settings.COURSE_ID_PATTERN}/$', views.ProductRecommendationsView.as_view(), name='product_recommendations'), - re_path(r"^courses/$", - views.DashboardRecommendationsApiView.as_view(), - name="courses"), - re_path(r'^recommendations_context/$', - views.RecommendationsContextView.as_view(), - name='recommendations_context'), + path("courses/", + views.DashboardRecommendationsApiView.as_view(), + name="courses"), + path('recommendations_context/', + views.RecommendationsContextView.as_view(), + name='recommendations_context'), ] diff --git a/lms/djangoapps/ora_staff_grader/urls.py b/lms/djangoapps/ora_staff_grader/urls.py index f4b0a39b19cb..a678009ccfbf 100644 --- a/lms/djangoapps/ora_staff_grader/urls.py +++ b/lms/djangoapps/ora_staff_grader/urls.py @@ -1,7 +1,7 @@ """ URLs for Enhanced Staff Grader (ESG) backend-for-frontend (BFF) """ -from django.conf.urls import include +from django.urls import include from django.urls import path