Replace deprecated django.conf.urls.url()

This method is deprecated in Django 3.1[1], in favor of
django.urls.re_path(), and triggers the following warning.

RemovedInDjango40Warning: django.conf.urls.url() is deprecated in favor
of django.urls.re_path().

This was already fixed in Horizon by [2].

[1] https://docs.djangoproject.com/en/4.0/releases/3.1/#id2
[2] d9266fd82c1f0acc6b7236a6dc9b7e510985eb13

Change-Id: I5f7fcb7fd49d81415385ae410a9ebfecd58ef120
This commit is contained in:
Takashi Kajinami 2022-07-11 00:00:54 +09:00
parent 09d63aefbc
commit f12ae10c68
7 changed files with 75 additions and 72 deletions

View File

@ -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<action_execution_id>[^/]+)/%s$'
TASKS = r'^(?P<task_id>[^/]+)/%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')
]

View File

@ -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<action_name>[^/]+)/%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'),
]

View File

@ -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<cron_trigger_name>[^/]+)/%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'),
]

View File

@ -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<execution_id>[^/]+)/%s$'
TASKS = r'^(?P<task_execution_id>[^/]+)/%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'),
]

View File

@ -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<task_id>[^/]+)/%s$'
EXECUTIONS = r'^(?P<execution_id>[^/]+)/%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'),
]

View File

@ -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<workbook_name>[^/]+)/%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'),
]

View File

@ -12,26 +12,28 @@
# 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<workflow_name>[^/]+)/%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'),
]