diff --git a/pretalx_broadcast_tools/urls.py b/pretalx_broadcast_tools/urls.py index 876d38d..554348c 100644 --- a/pretalx_broadcast_tools/urls.py +++ b/pretalx_broadcast_tools/urls.py @@ -1,5 +1,4 @@ -from django.urls import re_path -from pretalx.event.models.event import SLUG_REGEX +from django.urls import include, path from .views.event_info import BroadcastToolsEventInfoView from .views.orga import BroadcastToolsOrgaView @@ -8,38 +7,45 @@ from .views.schedule import BroadcastToolsScheduleView from .views.static_html import BroadcastToolsLowerThirdsView, BroadcastToolsRoomInfoView urlpatterns = [ - re_path( - rf"^(?P{SLUG_REGEX})/p/broadcast-tools/event.json$", - BroadcastToolsEventInfoView.as_view(), - name="event_info", + path( + "/p/broadcast-tools/", + include( + [ + path( + "event.json", + BroadcastToolsEventInfoView.as_view(), + name="event_info", + ), + path( + "schedule.json", + BroadcastToolsScheduleView.as_view(), + name="schedule", + ), + path( + "lower-thirds/", + BroadcastToolsLowerThirdsView.as_view(), + name="lowerthirds", + ), + path( + "feedback-qr/.svg", + BroadcastToolsFeedbackQrCodeSvg.as_view(), + name="feedback_qr_id", + ), + path( + "public-qr/.svg", + BroadcastToolsPublicQrCodeSvg.as_view(), + name="public_qr_id", + ), + path( + "room-info/", + BroadcastToolsRoomInfoView.as_view(), + name="room_info", + ), + ], + ), ), - re_path( - f"^(?P{SLUG_REGEX})/p/broadcast-tools/schedule.json$", - BroadcastToolsScheduleView.as_view(), - name="schedule", - ), - re_path( - f"^(?P{SLUG_REGEX})/p/broadcast-tools/lower-thirds/$", - BroadcastToolsLowerThirdsView.as_view(), - name="lowerthirds", - ), - re_path( - f"^(?P{SLUG_REGEX})/p/broadcast-tools/feedback-qr/(?P[0-9]+).svg$", - BroadcastToolsFeedbackQrCodeSvg.as_view(), - name="feedback_qr_id", - ), - re_path( - f"^(?P{SLUG_REGEX})/p/broadcast-tools/public-qr/(?P[0-9]+).svg$", - BroadcastToolsPublicQrCodeSvg.as_view(), - name="public_qr_id", - ), - re_path( - f"^(?P{SLUG_REGEX})/p/broadcast-tools/room-info/$", - BroadcastToolsRoomInfoView.as_view(), - name="room_info", - ), - re_path( - f"^orga/event/(?P{SLUG_REGEX})/settings/p/broadcast-tools/$", + path( + "orga/event//settings/p/broadcast-tools/", BroadcastToolsOrgaView.as_view(), name="orga", ),