Commit f9482e0d authored by Samuel GAIST's avatar Samuel GAIST

[urls] Migrate to new Django style using path

parent 60b19050
Pipeline #43206 passed with stage
in 15 minutes and 58 seconds
......@@ -25,20 +25,21 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import views
app_name = "accounts"
urlpatterns = [
url(r"^settings/$", views.account_settings, name="settings"),
url(
path("settings/", views.account_settings, name="settings"),
re_path(
r"^validation/(?P<hash_url>\w+)/$",
views.load_temporary_url_validation,
name="temp_url_validation",
),
url(
re_path(
r"^rejection/(?P<hash_url>\w+)/$",
views.load_temporary_url_rejection,
name="temp_url_rejection",
......
......@@ -25,38 +25,38 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import views
app_name = "algorithms"
urlpatterns = [
url(r"^new/$", views.create, name="new",),
url(r"^update/(?P<name>[-\w]+)/$", views.create, name="new-version",),
url(r"^$", views.public_ls, name="public-list",),
url(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
url(
path("new/", views.create, name="new",),
re_path(r"^update/(?P<name>[-\w]+)/$", views.create, name="new-version",),
path("", views.public_ls, name="public-list",),
re_path(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
re_path(
r"^fork/(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.fork,
name="fork",
),
url(
re_path(
r"^edit/(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.edit,
name="edit",
),
url(
re_path(
r"^diff/(?P<author1>\w+)/(?P<name1>[-\w]+)/(?P<version1>\d+)/(?P<author2>\w+)/(?P<name2>[-\w]+)/(?P<version2>\d+)/$",
views.diff,
name="diff",
),
url(r"^(?P<author>\w+)/(?P<name>[-\w]+)/$", views.view, name="view-latest",),
url(
re_path(r"^(?P<author>\w+)/(?P<name>[-\w]+)/$", views.view, name="view-latest",),
re_path(
r"^(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.view,
name="view",
),
url(r"^$", views.public_ls, name="public-list",),
url(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
re_path(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
]
......@@ -25,14 +25,15 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import views
app_name = "attestations"
urlpatterns = [
url(r"^$", views.public_ls, name="public-list",),
url(r"^(?P<number>\d+)/$", views.view, name="view",),
url(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
path("", views.public_ls, name="public-list",),
path("<int:number>/", views.view, name="view",),
re_path(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
]
......@@ -25,24 +25,23 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import views
app_name = "backend"
urlpatterns = [
url(r"^scheduler/$", views.scheduler, name="scheduler",),
url(
r"^cancel-experiments/$",
views.cancel_all_experiments,
name="cancel-experiments",
path("scheduler/", views.scheduler, name="scheduler",),
path(
"cancel-experiments/", views.cancel_all_experiments, name="cancel-experiments",
),
url(r"^update-workers/$", views.update_workers, name="update-workers",),
url(
path("update-workers/", views.update_workers, name="update-workers",),
re_path(
r"^environments/(?P<name>[-\.\w\s+]+)/(?P<version>[-\.\w]+)/$",
views.environment,
name="view-environment",
),
url(r"^environments/$", views.list_environments, name="list-environments",),
path("environments/", views.list_environments, name="list-environments",),
]
......@@ -25,14 +25,15 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import views
app_name = "databases"
urlpatterns = [
url(r"^$", views.ls, name="list",),
url(r"^(?P<name>[-\w]+)/(?P<version>\d+)/$", views.view, name="view"),
url(r"^(?P<name>[-\w]+)/$", views.view, name="view-latest",),
path(r"", views.ls, name="list",),
re_path(r"^(?P<name>[-\w]+)/(?P<version>\d+)/$", views.view, name="view"),
re_path(r"^(?P<name>[-\w]+)/$", views.view, name="view-latest",),
]
......@@ -25,36 +25,37 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import views
app_name = "dataformats"
urlpatterns = [
url(r"^new/$", views.create, name="new",),
url(r"^update/(?P<name>[-\w]+)/$", views.create, name="new-version",),
url(r"^$", views.public_ls, name="public-list",),
url(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
url(
path("new/", views.create, name="new",),
re_path(r"^update/(?P<name>[-\w]+)/$", views.create, name="new-version",),
path("", views.public_ls, name="public-list",),
re_path(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
re_path(
r"^fork/(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.fork,
name="fork",
),
url(
re_path(
r"^edit/(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.edit,
name="edit",
),
url(
re_path(
r"^diff/(?P<author1>\w+)/(?P<name1>[-\w]+)/(?P<version1>\d+)/(?P<author2>\w+)/(?P<name2>[-\w]+)/(?P<version2>\d+)/$",
views.diff,
name="diff",
),
url(
re_path(
r"^(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.view,
name="view",
),
url(r"^(?P<author>\w+)/(?P<name>[-\w]+)/$", views.view, name="view-latest",),
re_path(r"^(?P<author>\w+)/(?P<name>[-\w]+)/$", views.view, name="view-latest",),
]
......@@ -25,33 +25,34 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import views
app_name = "experiments"
urlpatterns = [
url(
re_path(
r"^setup/(?P<toolchain_author_name>[-\w]+)/(?P<toolchain_name>[-\w]+)/(?P<toolchain_version>\d+)/$",
views.new_from_toolchain,
name="new-from-toolchain",
),
url(
re_path(
r"^reset/(?P<toolchain_author_name>[-\w]+)/(?P<toolchain_name>[-\w]+)/(?P<toolchain_version>\d+)/(?P<name>[-\w]+)/$",
views.reset,
name="reset",
),
url(
re_path(
r"^fork/(?P<author_name>\w+)/(?P<toolchain_author_name>[-\w]+)/(?P<toolchain_name>[-\w]+)/(?P<toolchain_version>\d+)/(?P<name>[-\w]+)/$",
views.fork,
name="fork",
),
url(
re_path(
r"^(?P<author_name>\w+)/(?P<toolchain_author_name>[-\w]+)/(?P<toolchain_name>[-\w]+)/(?P<toolchain_version>\d+)/(?P<name>[-\w]+)/$",
views.view,
name="view",
),
url(r"^$", views.public_ls, name="public-list",),
url(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
path("", views.public_ls, name="public-list",),
re_path(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
]
......@@ -25,36 +25,39 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import views
app_name = "libraries"
urlpatterns = [
url(r"^new/$", views.create, name="new",),
url(r"^update/(?P<name>[-\w]+)/$", views.new_version, name="new-version",),
url(
path("new/", views.create, name="new",),
re_path(r"^update/(?P<name>[-\w]+)/$", views.new_version, name="new-version",),
re_path(
r"^fork/(?P<author_name>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.fork,
name="fork",
),
url(
re_path(
r"^edit/(?P<author_name>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.edit,
name="edit",
),
url(
re_path(
r"^diff/(?P<author1>\w+)/(?P<name1>[-\w]+)/(?P<version1>\d+)/(?P<author2>\w+)/(?P<name2>[-\w]+)/(?P<version2>\d+)/$",
views.diff,
name="diff",
),
url(
re_path(
r"^(?P<author_name>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.view,
name="view",
),
url(r"^(?P<author_name>\w+)/(?P<name>[-\w]+)/$", views.view, name="view-latest",),
url(r"^$", views.public_ls, name="public-list",),
url(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
re_path(
r"^(?P<author_name>\w+)/(?P<name>[-\w]+)/$", views.view, name="view-latest",
),
path("", views.public_ls, name="public-list",),
re_path(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
]
......@@ -25,12 +25,12 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from . import views
urlpatterns = [
url(r"^tos/$", views.terms_of_service, name="terms-of-service",),
url(r"^disclaimer/$", views.legal_disclaimer, name="legal-disclaimer",),
url(r"^contact/$", views.contact, name="contact",),
path("tos/", views.terms_of_service, name="terms-of-service",),
path("disclaimer/", views.legal_disclaimer, name="legal-disclaimer",),
path("contact/", views.contact, name="contact",),
]
......@@ -25,8 +25,9 @@
# #
###############################################################################
from django.conf.urls import include
from django.conf.urls import url
from django.urls import include
from django.urls import path
from django.urls import re_path
from . import views
......@@ -34,21 +35,21 @@ app_name = "plotters"
partial_patterns = (
[
url(
r"^plotinfo/$",
path(
"plotinfo",
views.PartialGroupView.as_view(
template_name="plotterparameters/partials/plotgraphicinfo.html",
),
name="plotinfo",
),
url(
r"^plotparamsinfo/$",
path(
"plotparamsinfo/",
views.PartialGroupView.as_view(
template_name="plotterparameters/partials/plotparamsinfo.html",
),
name="plotinfo",
),
url(
re_path(
r"^(?P<template_name>[a-zA-Z_]+\.html)$", views.PartialGroupView.as_view(),
),
],
......@@ -56,61 +57,61 @@ partial_patterns = (
)
urlpatterns = [
url(r"^partials/", include(partial_patterns),),
url(r"^$", views.list_plotters, name="list",),
url(r"^plot/$", views.plot, name="plot",),
url(r"^plot_sample/$", views.plot_sample, name="plot_sample",),
url(
r"^plot_sample_with_params/$",
path("partials/", include(partial_patterns),),
path("", views.list_plotters, name="list",),
path("plot/", views.plot, name="plot",),
path("plot_sample/", views.plot_sample, name="plot_sample",),
path(
"plot_sample_with_params/",
views.plot_sample_with_params,
name="plot_sample_with_params",
),
url(
re_path(
r"^plotterparameter/(?P<author_name>\w+)/new_plotterparameter/$",
views.create_plotterparameter,
name="new_plotterparameter",
),
url(
re_path(
r"^plotterparameter/(?P<author_name>\w+)/(?P<plotterparameter_name>[-\w]+)/(?P<version>\d+)/new/$",
views.create_new_version,
name="new-version",
),
url(
re_path(
r"^plotterparameter/(?P<author_name>\w+)/(?P<plotterparameter_name>[-\w]+)/(?P<version>\d+)/fork/$",
views.fork,
name="fork",
),
url(
re_path(
r"^plotterparameter/diff/(?P<author1>\w+)/(?P<name1>[-\w]+)/(?P<version1>\d+)/(?P<author2>\w+)/(?P<name2>[-\w]+)/(?P<version2>\d+)/$",
views.diff,
name="diff",
),
url(
re_path(
r"^(?P<author_name>\w+)/plotterparameter/$",
views.list_plotterparameters,
name="plotterparameter-list",
),
url(
r"^plotterparameter/$",
path(
"plotterparameter/",
views.list_plotterparameters_public,
name="plotterparameter-public-list",
),
url(
re_path(
r"^plotterparameter/(?P<author_name>\w+)/(?P<plotterparameter_name>[-\w]+)/(?P<version>\d+)/$",
views.plotterparameter_for_author,
name="plotterparameter-author-view",
),
url(
re_path(
r"^(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.view,
name="view",
),
url(
re_path(
r"^plotterparameter/(?P<author>\w+)/(?P<name>[-\w]+)/$",
views.plotterparameter_latest,
name="plotterparameter-view-latest",
),
url(
re_path(
r"^(?P<author>\w+)/(?P<name>[-\w]+)/$", views.view, name="plotter-view-latest",
),
]
......@@ -25,22 +25,25 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import views
app_name = "reports"
partial_patterns = [
url(r"^(?P<template_name>[a-zA-Z_]+\.html)$", views.PartialGroupView.as_view(),),
re_path(
r"^(?P<template_name>[a-zA-Z_]+\.html)$", views.PartialGroupView.as_view(),
),
]
urlpatterns = [
url(r"^$", views.public_ls, name="public-list",),
url(r"^(?P<number>\d+)/$", views.by_number, name="view",),
url(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
url(
path("", views.public_ls, name="public-list",),
path("<int:number>/", views.by_number, name="view",),
re_path(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
re_path(
r"^(?P<author_name>\w+)/(?P<report_name>[-\w]+)/$",
views.for_author,
name="author-view",
......
......@@ -25,18 +25,21 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import views
app_name = "search"
urlpatterns = [
url(r"^$", views.public_ls, name="public-list",),
url(r"^run/$", views.search, name="search",),
url(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
url(r"^(?P<author_name>\w+)/(?P<query_name>[\w\-]+)/$", views.view, name="view",),
url(
path(r"", views.public_ls, name="public-list",),
path(r"run/", views.search, name="search",),
re_path(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
re_path(
r"^(?P<author_name>\w+)/(?P<query_name>[\w\-]+)/$", views.view, name="view",
),
re_path(
r"^(?P<author_name>\w+)/(?P<query_name>[\w\-]+)/notify/$",
views.notify,
name="notify",
......
......@@ -25,12 +25,12 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from . import views
app_name = "statistics"
urlpatterns = [
url(r"^$", views.statistics, name="summary",),
path(r"", views.statistics, name="summary",),
]
......@@ -25,16 +25,19 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import views
app_name = "teams"
urlpatterns = [
url(r"^new/$", views.create, name="new",),
url(r"^$", views.public_ls, name="public-list",),
url(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
url(r"^(?P<author_name>\w+)/(?P<name>[-\w\s]+)/$", views.view, name="view",),
url(r"^edit/(?P<author_name>\w+)/(?P<name>[-\w\s]+)/$", views.edit, name="edit",),
path("new/", views.create, name="new",),
path(r"", views.public_ls, name="public-list",),
re_path(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
re_path(r"^(?P<author_name>\w+)/(?P<name>[-\w\s]+)/$", views.view, name="view",),
re_path(
r"^edit/(?P<author_name>\w+)/(?P<name>[-\w\s]+)/$", views.edit, name="edit",
),
]
......@@ -25,36 +25,37 @@
# #
###############################################################################
from django.conf.urls import url
from django.urls import path
from django.urls import re_path
from . import views
app_name = "toolchains"
urlpatterns = [
url(r"^new/$", views.create, name="new",),
url(r"^new/(?P<name>[-\w]+)/$", views.create, name="new-version",),
url(r"^$", views.public_ls, name="public-list",),
url(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
url(
path("new", views.create, name="new",),
re_path(r"^new/(?P<name>[-\w]+)/$", views.create, name="new-version",),
path("", views.public_ls, name="public-list",),
re_path(r"^(?P<author_name>\w+)/$", views.ls, name="list",),
re_path(
r"^fork/(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.fork,
name="fork",
),
url(
re_path(
r"^edit/(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.edit,
name="edit",
),
url(
re_path(
r"^diff/(?P<author1>\w+)/(?P<name1>[-\w]+)/(?P<version1>\d+)/(?P<author2>\w+)/(?P<name2>[-\w]+)/(?P<version2>\d+)/$",
views.diff,
name="diff",
),
url(
re_path(
r"^(?P<author>\w+)/(?P<name>[-\w]+)/(?P<version>\d+)/$",
views.view,
name="view",
),
url(r"^(?P<author>\w+)/(?P<name>[-\w]+)/$", views.view, name="view-latest",),
re_path(r"(?P<author>\w+)/(?P<name>[-\w]+)/$", views.view, name="view-latest",),
]
......@@ -26,8 +26,9 @@
###############################################################################
from django.conf import settings
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.urls import path
from django.urls import re_path
from django.views.generic.base import TemplateView
from . import views
......@@ -38,30 +39,28 @@ from .registration.views import register
app_name = "ui"
urlpatterns = [
url(r"^$", views.index, name="index"),
url(r"^login/", views.LoginView.as_view(), name="login"),
url(r"^logout/", auth_views.LogoutView.as_view(next_page="index"), name="logout"),
url(
r"^blocked_user_reactivation/$",
path("", views.index, name="index"),
path("login/", views.LoginView.as_view(), name="login"),
path("logout/", auth_views.LogoutView.as_view(next_page="index"), name="logout"),
path(
"blocked_user_reactivation/",
views.blocked_user_reactivation,
name="blocked_user_reactivation",
),
url(
r"^events/(?P<author_name>\w+)/$", views.activity_stream, name="activity-stream"
),
url(r"^docreq/(?P<author_name>\w+)/$", views.docreq, name="docreq"),
path("events/<author_name>/", views.activity_stream, name="activity-stream"),
path("docreq/<author_name>/", views.docreq, name="docreq"),
# Activation keys get matched by \w+ instead of the more specific
# [a-fA-F0-9]{40} because a bad activation key should still get to the
# view; that way it can return a sensible "invalid key" message instead
# of a confusing 404.
url(
r"^signup/$",
path(
"signup/",
register,
dict(success_url="registration-complete"),
name="registration",
),
url(
r"^signup/complete/$",
path(
"signup/complete/",
TemplateView.as_view(
template_name=(
"registration/registration_pending.html"
......@@ -71,13 +70,11 @@ urlpatterns = [
),
name="registration-complete",
),
url(
r"^signup/activate/(?P<activation_key>\w+)/$",
activate,
name="registration-activation",
path(
"signup/activate/<activation_key>/", activate, name="registration-activation",
),
url(
r"^preregister/$",
path(
"preregister/",
register,
dict(
success_url="pre-registration-complete",
......@@ -86,36 +83,36 @@ urlpatterns = [
),
name="pre-registration",
),
url(
r"^preregistration/complete/$",
path(
"preregistration/complete/",
TemplateView.as_view(
template_name="registration/preregistration_complete.html"
),
name="pre-registration-complete",
),
url(
r"^password_reset/$",
path(
"password_reset/",
auth_views.PasswordResetView.as_view(
template_name="registration/password-reset-form.html"
),
name="password_reset",
),
url(
r"^password_reset/done/$",
path(
"password_reset/done/",
auth_views.PasswordResetDoneView.as_view(
template_name="registration/password-reset-done.html"
),
name="password_reset_done",
),
url(
re_path(
r"^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$",
auth_views.PasswordResetConfirmView.as_view(
template_name="registration/password-reset-confirm.html"
),
name="password_reset_confirm",
),
url(
r"^reset/done/$",
path(
"reset/done/",