From 6823e11ff0661f92da6abda46b4148610d07f3f8 Mon Sep 17 00:00:00 2001 From: Luca Date: Sat, 2 Nov 2024 19:20:35 +0100 Subject: [PATCH] refactor: match urls using pretalx' custom SLUG_REGEX --- pretalx_musicrate/urls.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pretalx_musicrate/urls.py b/pretalx_musicrate/urls.py index afbf7d6..211143a 100644 --- a/pretalx_musicrate/urls.py +++ b/pretalx_musicrate/urls.py @@ -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 ( AssigneeView, @@ -13,8 +14,8 @@ from .views import ( ) urlpatterns = [ - path( - "orga/event//", + re_path( + rf"^orga/event/(?P{SLUG_REGEX})/", include( [ path( @@ -39,8 +40,8 @@ urlpatterns = [ ] ), ), - path( - "/p/pretalx_musicrate/", + re_path( + rf"^(?P{SLUG_REGEX})/p/pretalx_musicrate/", include( [ path("", QRCodeView.as_view(), name="qrcode"),