mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
*: Use django.urls.re_path() instead of its alias url()
- In Django 2.2 django.conf.urls.url() is an alias to django.urls.re_path(). - In Django 4.0, url() function will be removed. On Django 3.2, it throws a warning that this function will be removed in future. Tests: - Run unit tests with Django 3.2 and Django 2.2. - With Django 3.2 there are no warnings when running unit tests and when running FreedomBox Service. - Visit a few affected apps with both Django versions. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
a3e21adc8b
commit
cd2b2f5f2c
65 files changed
+359
-338
No files matched your search
@@ -4,8 +4,7 @@ URLs for the Users module
|
||||
"""
|
||||
|
||||
from axes.decorators import axes_dispatch
|
||||
from django.conf.urls import url
|
||||
from django.urls import reverse_lazy
|
||||
from django.urls import re_path, reverse_lazy
|
||||
from stronghold.decorators import public
|
||||
|
||||
from plinth.modules.sso.views import SSOLoginView, SSOLogoutView
|
||||
@@ -14,24 +13,24 @@ from plinth.utils import non_admin_view
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^sys/users/$', views.UserList.as_view(), name='index'),
|
||||
url(r'^sys/users/create/$', views.UserCreate.as_view(), name='create'),
|
||||
url(r'^sys/users/(?P<slug>[\w.@+-]+)/edit/$',
|
||||
non_admin_view(views.UserUpdate.as_view()), name='edit'),
|
||||
url(r'^sys/users/(?P<slug>[\w.@+-]+)/delete/$', views.UserDelete.as_view(),
|
||||
name='delete'),
|
||||
url(r'^sys/users/(?P<slug>[\w.@+-]+)/change_password/$',
|
||||
non_admin_view(views.UserChangePassword.as_view()),
|
||||
name='change_password'),
|
||||
re_path(r'^sys/users/$', views.UserList.as_view(), name='index'),
|
||||
re_path(r'^sys/users/create/$', views.UserCreate.as_view(), name='create'),
|
||||
re_path(r'^sys/users/(?P<slug>[\w.@+-]+)/edit/$',
|
||||
non_admin_view(views.UserUpdate.as_view()), name='edit'),
|
||||
re_path(r'^sys/users/(?P<slug>[\w.@+-]+)/delete/$',
|
||||
views.UserDelete.as_view(), name='delete'),
|
||||
re_path(r'^sys/users/(?P<slug>[\w.@+-]+)/change_password/$',
|
||||
non_admin_view(views.UserChangePassword.as_view()),
|
||||
name='change_password'),
|
||||
|
||||
# Authnz is handled by SSO
|
||||
|
||||
# XXX: Use axes authentication backend and middleware instead of
|
||||
# axes_dispatch after axes 5.x becomes available in Debian stable.
|
||||
url(r'^accounts/login/$', public(axes_dispatch(SSOLoginView.as_view())),
|
||||
name='login'),
|
||||
url(r'^accounts/logout/$', non_admin_view(SSOLogoutView.as_view()),
|
||||
{'next_page': reverse_lazy('index')}, name='logout'),
|
||||
url(r'^users/firstboot/$', public(views.FirstBootView.as_view()),
|
||||
name='firstboot'),
|
||||
re_path(r'^accounts/login/$',
|
||||
public(axes_dispatch(SSOLoginView.as_view())), name='login'),
|
||||
re_path(r'^accounts/logout/$', non_admin_view(SSOLogoutView.as_view()),
|
||||
{'next_page': reverse_lazy('index')}, name='logout'),
|
||||
re_path(r'^users/firstboot/$', public(views.FirstBootView.as_view()),
|
||||
name='firstboot'),
|
||||
]
|
||||
Reference in new issue
Block a user