mirror of
https://github.com/jazzband/django-authority.git
synced 2026-05-03 05:04:52 +00:00
Replace url with re_path
This commit is contained in:
parent
250aafc9dc
commit
3ec438fdc7
2 changed files with 14 additions and 14 deletions
|
|
@ -1,37 +1,36 @@
|
|||
from django.conf.urls import url
|
||||
from django.urls import re_path
|
||||
from authority.views import (
|
||||
add_permission,
|
||||
delete_permission,
|
||||
approve_permission_request,
|
||||
delete_permission,
|
||||
)
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
url(
|
||||
re_path(
|
||||
r"^permission/add/(?P<app_label>[\w\-]+)/(?P<module_name>[\w\-]+)/(?P<pk>\d+)/$",
|
||||
view=add_permission,
|
||||
name="authority-add-permission",
|
||||
kwargs={"approved": True},
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r"^permission/delete/(?P<permission_pk>\d+)/$",
|
||||
view=delete_permission,
|
||||
name="authority-delete-permission",
|
||||
kwargs={"approved": True},
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r"^request/add/(?P<app_label>[\w\-]+)/(?P<module_name>[\w\-]+)/(?P<pk>\d+)/$",
|
||||
view=add_permission,
|
||||
name="authority-add-permission-request",
|
||||
kwargs={"approved": False},
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r"^request/approve/(?P<permission_pk>\d+)/$",
|
||||
view=approve_permission_request,
|
||||
name="authority-approve-permission-request",
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r"^request/delete/(?P<permission_pk>\d+)/$",
|
||||
view=delete_permission,
|
||||
name="authority-delete-permission-request",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import django.contrib.auth.views
|
||||
from django.conf.urls import include, handler500, url
|
||||
from django.conf.urls import include, handler500
|
||||
from django.conf import settings
|
||||
from django.urls import re_path
|
||||
|
||||
import authority.views
|
||||
import authority.urls
|
||||
|
|
@ -13,21 +14,21 @@ authority.autodiscover()
|
|||
handler500 # flake8
|
||||
|
||||
urlpatterns = (
|
||||
url(
|
||||
re_path(
|
||||
r"^authority/permission/add/(?P<app_label>[\w\-]+)/(?P<module_name>[\w\-]+)/(?P<pk>\d+)/$", # noqa
|
||||
view=authority.views.add_permission,
|
||||
name="authority-add-permission",
|
||||
kwargs={"approved": True, "form_class": SpecialUserPermissionForm},
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r"^request/add/(?P<app_label>[\w\-]+)/(?P<module_name>[\w\-]+)/(?P<pk>\d+)/$", # noqa
|
||||
view=authority.views.add_permission,
|
||||
name="authority-add-permission-request",
|
||||
kwargs={"approved": False, "form_class": SpecialUserPermissionForm},
|
||||
),
|
||||
url(r"^authority/", include(authority.urls)),
|
||||
url(r"^accounts/login/$", django.contrib.auth.views.LoginView.as_view()),
|
||||
url(
|
||||
re_path(r"^authority/", include(authority.urls)),
|
||||
re_path(r"^accounts/login/$", django.contrib.auth.views.LoginView.as_view()),
|
||||
re_path(
|
||||
r"^(?P<url>[\/0-9A-Za-z]+)$",
|
||||
example.exampleapp.views.top_secret,
|
||||
{"lala": "oh yeah!"},
|
||||
|
|
@ -36,7 +37,7 @@ urlpatterns = (
|
|||
|
||||
if settings.DEBUG:
|
||||
urlpatterns += (
|
||||
url(
|
||||
re_path(
|
||||
r"^media/(?P<path>.*)$",
|
||||
django.views.static.serve,
|
||||
{"document_root": settings.MEDIA_ROOT,},
|
||||
|
|
|
|||
Loading…
Reference in a new issue