From 72e898910f0a6f76d7bebd748fa4052003c09479 Mon Sep 17 00:00:00 2001 From: manchandavishal Date: Fri, 29 Apr 2022 16:32:23 +0530 Subject: [PATCH] Address RemovedInDjango40Warning In Django 3.1, django.conf.urls.url() is deprecated in favor of django.urls.re_path(). For more info see [1] These were already replaced in Horizon repo by [2]. [1] https://docs.djangoproject.com/en/4.0/releases/3.1/#id2 [2] https://review.opendev.org/c/openstack/horizon/+/827093 Change-Id: I3e95a2ec718b473ffed698652f6bdaba4e9de8a5 --- mistraldashboard/action_executions/urls.py | 24 ++++++++-------- mistraldashboard/actions/urls.py | 12 ++++---- mistraldashboard/cron_triggers/urls.py | 9 +++--- mistraldashboard/executions/urls.py | 26 ++++++++--------- mistraldashboard/tasks/urls.py | 20 ++++++------- mistraldashboard/workbooks/urls.py | 22 +++++++-------- mistraldashboard/workflows/urls.py | 33 +++++++++++----------- 7 files changed, 74 insertions(+), 72 deletions(-) diff --git a/mistraldashboard/action_executions/urls.py b/mistraldashboard/action_executions/urls.py index 77747ed..618f7b9 100644 --- a/mistraldashboard/action_executions/urls.py +++ b/mistraldashboard/action_executions/urls.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import url # noqa +from django.urls import re_path from mistraldashboard.action_executions import views @@ -20,15 +20,15 @@ ACTION_EXECUTIONS = r'^(?P[^/]+)/%s$' TASKS = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(ACTION_EXECUTIONS % 'detail', views.OverviewView.as_view(), - name='detail'), - url(ACTION_EXECUTIONS % 'input', views.CodeView.as_view(), - {'column': 'input'}, name='input'), - url(ACTION_EXECUTIONS % 'output', views.CodeView.as_view(), - {'column': 'output'}, name='output'), - url(ACTION_EXECUTIONS % 'update', views.UpdateView.as_view(), - name='update'), - url(TASKS % 'task', views.FilteredByTaskView.as_view(), - name='task') + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(ACTION_EXECUTIONS % 'detail', views.OverviewView.as_view(), + name='detail'), + re_path(ACTION_EXECUTIONS % 'input', views.CodeView.as_view(), + {'column': 'input'}, name='input'), + re_path(ACTION_EXECUTIONS % 'output', views.CodeView.as_view(), + {'column': 'output'}, name='output'), + re_path(ACTION_EXECUTIONS % 'update', views.UpdateView.as_view(), + name='update'), + re_path(TASKS % 'task', views.FilteredByTaskView.as_view(), + name='task') ] diff --git a/mistraldashboard/actions/urls.py b/mistraldashboard/actions/urls.py index e1676de..e6d15be 100644 --- a/mistraldashboard/actions/urls.py +++ b/mistraldashboard/actions/urls.py @@ -12,16 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import url # noqa +from django.urls import re_path from mistraldashboard.actions import views ACTIONS = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(ACTIONS % 'detail', views.DetailView.as_view(), name='detail'), - url(ACTIONS % 'run', views.RunView.as_view(), name='run'), - url(r'^create$', views.CreateView.as_view(), name='create'), - url(r'^update$', views.UpdateView.as_view(), name='update'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(ACTIONS % 'detail', views.DetailView.as_view(), name='detail'), + re_path(ACTIONS % 'run', views.RunView.as_view(), name='run'), + re_path(r'^create$', views.CreateView.as_view(), name='create'), + re_path(r'^update$', views.UpdateView.as_view(), name='update'), ] diff --git a/mistraldashboard/cron_triggers/urls.py b/mistraldashboard/cron_triggers/urls.py index 6b32c42..0edbb84 100644 --- a/mistraldashboard/cron_triggers/urls.py +++ b/mistraldashboard/cron_triggers/urls.py @@ -12,14 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import url # noqa +from django.urls import re_path from mistraldashboard.cron_triggers import views CRON_TRIGGERS = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(CRON_TRIGGERS % 'detail', views.OverviewView.as_view(), name='detail'), - url(r'^create$', views.CreateView.as_view(), name='create'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(CRON_TRIGGERS % 'detail', views.OverviewView.as_view(), + name='detail'), + re_path(r'^create$', views.CreateView.as_view(), name='create'), ] diff --git a/mistraldashboard/executions/urls.py b/mistraldashboard/executions/urls.py index 3777c08..5a904d7 100644 --- a/mistraldashboard/executions/urls.py +++ b/mistraldashboard/executions/urls.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import url # noqa +from django.urls import re_path from mistraldashboard.executions import views @@ -20,16 +20,16 @@ EXECUTIONS = r'^(?P[^/]+)/%s$' TASKS = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(EXECUTIONS % 'detail', views.DetailView.as_view(), name='detail'), - url(TASKS % 'tasks', views.TasksView.as_view(), name='tasks'), - url(EXECUTIONS % 'detail_task_id', views.DetailView.as_view(), - {'caller': 'task'}, name='detail_task_id'), - url(EXECUTIONS % 'output', views.CodeView.as_view(), - {'column': 'output'}, name='output'), - url(EXECUTIONS % 'input', views.CodeView.as_view(), - {'column': 'input'}, name='input'), - url(EXECUTIONS % 'update_description', - views.UpdateDescriptionView.as_view(), - name='update_description'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(EXECUTIONS % 'detail', views.DetailView.as_view(), name='detail'), + re_path(TASKS % 'tasks', views.TasksView.as_view(), name='tasks'), + re_path(EXECUTIONS % 'detail_task_id', views.DetailView.as_view(), + {'caller': 'task'}, name='detail_task_id'), + re_path(EXECUTIONS % 'output', views.CodeView.as_view(), + {'column': 'output'}, name='output'), + re_path(EXECUTIONS % 'input', views.CodeView.as_view(), + {'column': 'input'}, name='input'), + re_path(EXECUTIONS % 'update_description', + views.UpdateDescriptionView.as_view(), + name='update_description'), ] diff --git a/mistraldashboard/tasks/urls.py b/mistraldashboard/tasks/urls.py index f418023..864be3e 100644 --- a/mistraldashboard/tasks/urls.py +++ b/mistraldashboard/tasks/urls.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import url # noqa +from django.urls import re_path from mistraldashboard.tasks import views @@ -20,13 +20,13 @@ TASKS = r'^(?P[^/]+)/%s$' EXECUTIONS = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(TASKS % 'detail', views.OverviewView.as_view(), name='detail'), - url(EXECUTIONS % 'execution', - views.ExecutionView.as_view(), - name='execution'), - url(TASKS % 'result', views.CodeView.as_view(), - {'column': 'result'}, name='result'), - url(TASKS % 'published', views.CodeView.as_view(), - {'column': 'published'}, name='published'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(TASKS % 'detail', views.OverviewView.as_view(), name='detail'), + re_path(EXECUTIONS % 'execution', + views.ExecutionView.as_view(), + name='execution'), + re_path(TASKS % 'result', views.CodeView.as_view(), + {'column': 'result'}, name='result'), + re_path(TASKS % 'published', views.CodeView.as_view(), + {'column': 'published'}, name='published'), ] diff --git a/mistraldashboard/workbooks/urls.py b/mistraldashboard/workbooks/urls.py index 78b5ea6..d89d3de 100644 --- a/mistraldashboard/workbooks/urls.py +++ b/mistraldashboard/workbooks/urls.py @@ -12,21 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import url # noqa +from django.urls import re_path from mistraldashboard.workbooks import views WORKBOOKS = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^select_definition$', - views.SelectDefinitionView.as_view(), - name='select_definition'), - url(r'^change_definition$', - views.ChangeDefinitionView.as_view(), - name='change_definition'), - url(r'^create$', views.CreateView.as_view(), name='create'), - url(r'^update$', views.UpdateView.as_view(), name='update'), - url(WORKBOOKS % 'detail', views.DetailView.as_view(), name='detail'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^select_definition$', + views.SelectDefinitionView.as_view(), + name='select_definition'), + re_path(r'^change_definition$', + views.ChangeDefinitionView.as_view(), + name='change_definition'), + re_path(r'^create$', views.CreateView.as_view(), name='create'), + re_path(r'^update$', views.UpdateView.as_view(), name='update'), + re_path(WORKBOOKS % 'detail', views.DetailView.as_view(), name='detail'), ] diff --git a/mistraldashboard/workflows/urls.py b/mistraldashboard/workflows/urls.py index 1bb644e..1809796 100644 --- a/mistraldashboard/workflows/urls.py +++ b/mistraldashboard/workflows/urls.py @@ -12,26 +12,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import url # noqa +from django.urls import re_path from mistraldashboard.workflows import views WORKFLOWS = r'^(?P[^/]+)/%s$' urlpatterns = [ - url(r'^$', views.IndexView.as_view(), name='index'), - url(r'^select_definition$', - views.SelectDefinitionView.as_view(), - name='select_definition'), - url(r'^change_definition$', - views.ChangeDefinitionView.as_view(), - name='change_definition'), - url(r'^create$', views.CreateView.as_view(), name='create'), - url(r'^update$', views.UpdateView.as_view(), name='update'), - url(WORKFLOWS % 'execute', views.ExecuteView.as_view(), name='execute'), - url(WORKFLOWS % 'detail', views.DetailView.as_view(), name='detail'), - url(WORKFLOWS % 'definition', views.CodeView.as_view(), - {'column': 'definition'}, name='definition'), - url(WORKFLOWS % 'input', views.CodeView.as_view(), - {'column': 'input'}, name='input'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^select_definition$', + views.SelectDefinitionView.as_view(), + name='select_definition'), + re_path(r'^change_definition$', + views.ChangeDefinitionView.as_view(), + name='change_definition'), + re_path(r'^create$', views.CreateView.as_view(), name='create'), + re_path(r'^update$', views.UpdateView.as_view(), name='update'), + re_path(WORKFLOWS % 'execute', views.ExecuteView.as_view(), + name='execute'), + re_path(WORKFLOWS % 'detail', views.DetailView.as_view(), name='detail'), + re_path(WORKFLOWS % 'definition', views.CodeView.as_view(), + {'column': 'definition'}, name='definition'), + re_path(WORKFLOWS % 'input', views.CodeView.as_view(), + {'column': 'input'}, name='input'), ]