refactor: match urls using pretalx' custom SLUG_REGEX

This commit is contained in:
Luca 2024-11-02 19:20:35 +01:00
parent a693370a7d
commit 6823e11ff0
1 changed files with 6 additions and 5 deletions

View File

@ -1,4 +1,5 @@
from django.urls import include, path from django.urls import include, path, re_path
from pretalx.event.models.event import SLUG_REGEX
from .views import ( from .views import (
AssigneeView, AssigneeView,
@ -13,8 +14,8 @@ from .views import (
) )
urlpatterns = [ urlpatterns = [
path( re_path(
"orga/event/<slug:event>/", rf"^orga/event/(?P<event>{SLUG_REGEX})/",
include( include(
[ [
path( path(
@ -39,8 +40,8 @@ urlpatterns = [
] ]
), ),
), ),
path( re_path(
"<slug:event>/p/pretalx_musicrate/", rf"^(?P<event>{SLUG_REGEX})/p/pretalx_musicrate/",
include( include(
[ [
path("", QRCodeView.as_view(), name="qrcode"), path("", QRCodeView.as_view(), name="qrcode"),