Skip to content

Commit 2a5845d

Browse files
use path in urls (#1456)
replaces re_path with simple, straightforward path, removing unnecessary regex. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent dc3d8ff commit 2a5845d

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

Diff for: oauth2_provider/urls.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from django.urls import re_path
1+
from django.urls import path, re_path
22

33
from . import views
44

@@ -7,24 +7,24 @@
77

88

99
base_urlpatterns = [
10-
re_path(r"^authorize/$", views.AuthorizationView.as_view(), name="authorize"),
11-
re_path(r"^token/$", views.TokenView.as_view(), name="token"),
12-
re_path(r"^revoke_token/$", views.RevokeTokenView.as_view(), name="revoke-token"),
13-
re_path(r"^introspect/$", views.IntrospectTokenView.as_view(), name="introspect"),
10+
path("authorize/", views.AuthorizationView.as_view(), name="authorize"),
11+
path("token/", views.TokenView.as_view(), name="token"),
12+
path("revoke_token/", views.RevokeTokenView.as_view(), name="revoke-token"),
13+
path("introspect/", views.IntrospectTokenView.as_view(), name="introspect"),
1414
]
1515

1616

1717
management_urlpatterns = [
1818
# Application management views
19-
re_path(r"^applications/$", views.ApplicationList.as_view(), name="list"),
20-
re_path(r"^applications/register/$", views.ApplicationRegistration.as_view(), name="register"),
21-
re_path(r"^applications/(?P<pk>[\w-]+)/$", views.ApplicationDetail.as_view(), name="detail"),
22-
re_path(r"^applications/(?P<pk>[\w-]+)/delete/$", views.ApplicationDelete.as_view(), name="delete"),
23-
re_path(r"^applications/(?P<pk>[\w-]+)/update/$", views.ApplicationUpdate.as_view(), name="update"),
19+
path("applications/", views.ApplicationList.as_view(), name="list"),
20+
path("applications/register/", views.ApplicationRegistration.as_view(), name="register"),
21+
path("applications/<slug:pk>/", views.ApplicationDetail.as_view(), name="detail"),
22+
path("applications/<slug:pk>/delete/", views.ApplicationDelete.as_view(), name="delete"),
23+
path("applications/<slug:pk>/update/", views.ApplicationUpdate.as_view(), name="update"),
2424
# Token management views
25-
re_path(r"^authorized_tokens/$", views.AuthorizedTokensListView.as_view(), name="authorized-token-list"),
26-
re_path(
27-
r"^authorized_tokens/(?P<pk>[\w-]+)/delete/$",
25+
path("authorized_tokens/", views.AuthorizedTokensListView.as_view(), name="authorized-token-list"),
26+
path(
27+
"authorized_tokens/<slug:pk>/delete/",
2828
views.AuthorizedTokenDeleteView.as_view(),
2929
name="authorized-token-delete",
3030
),
@@ -40,9 +40,9 @@
4040
views.ConnectDiscoveryInfoView.as_view(),
4141
name="oidc-connect-discovery-info",
4242
),
43-
re_path(r"^\.well-known/jwks.json$", views.JwksInfoView.as_view(), name="jwks-info"),
44-
re_path(r"^userinfo/$", views.UserInfoView.as_view(), name="user-info"),
45-
re_path(r"^logout/$", views.RPInitiatedLogoutView.as_view(), name="rp-initiated-logout"),
43+
path(".well-known/jwks.json", views.JwksInfoView.as_view(), name="jwks-info"),
44+
path("userinfo/", views.UserInfoView.as_view(), name="user-info"),
45+
path("logout/", views.RPInitiatedLogoutView.as_view(), name="rp-initiated-logout"),
4646
]
4747

4848

0 commit comments

Comments
 (0)