From 2eb8fbcd6a4cf6ca740d3d9b6f8946dd0b427187 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= <fpeters@entrouvert.com>
Date: Wed, 6 Mar 2019 11:16:25 +0100
Subject: [PATCH] manager: limit URL primary key matches to digits (#31122)

---
 chrono/manager/urls.py | 46 +++++++++++++++++++++---------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/chrono/manager/urls.py b/chrono/manager/urls.py
index d304ab9..367278a 100644
--- a/chrono/manager/urls.py
+++ b/chrono/manager/urls.py
@@ -24,59 +24,59 @@ urlpatterns = [
             name='chrono-manager-agenda-add'),
         url(r'^agendas/import/$', views.agendas_import,
             name='chrono-manager-agendas-import'),
-        url(r'^agendas/(?P<pk>\w+)/$', views.agenda_view,
+        url(r'^agendas/(?P<pk>\d+)/$', views.agenda_view,
             name='chrono-manager-agenda-view'),
-        url(r'^agendas/(?P<pk>\w+)/(?P<year>[0-9]{4})/(?P<month>[0-9]+)/$', views.agenda_monthly_view,
+        url(r'^agendas/(?P<pk>\d+)/(?P<year>[0-9]{4})/(?P<month>[0-9]+)/$', views.agenda_monthly_view,
             name='chrono-manager-agenda-month-view'),
-        url(r'^agendas/(?P<pk>\w+)/(?P<year>[0-9]{4})/(?P<month>[0-9]+)/(?P<day>[0-9]+)/$', views.agenda_day_view,
+        url(r'^agendas/(?P<pk>\d+)/(?P<year>[0-9]{4})/(?P<month>[0-9]+)/(?P<day>[0-9]+)/$', views.agenda_day_view,
             name='chrono-manager-agenda-day-view'),
-        url(r'^agendas/(?P<pk>\w+)/settings$', views.agenda_settings,
+        url(r'^agendas/(?P<pk>\d+)/settings$', views.agenda_settings,
             name='chrono-manager-agenda-settings'),
-        url(r'^agendas/(?P<pk>\w+)/edit$', views.agenda_edit,
+        url(r'^agendas/(?P<pk>\d+)/edit$', views.agenda_edit,
             name='chrono-manager-agenda-edit'),
-        url(r'^agendas/(?P<pk>\w+)/delete$', views.agenda_delete,
+        url(r'^agendas/(?P<pk>\d+)/delete$', views.agenda_delete,
             name='chrono-manager-agenda-delete'),
-        url(r'^agendas/(?P<pk>\w+)/export$', views.agenda_export,
+        url(r'^agendas/(?P<pk>\d+)/export$', views.agenda_export,
             name='chrono-manager-agenda-export'),
-        url(r'^agendas/(?P<pk>\w+)/add-event$', views.agenda_add_event,
+        url(r'^agendas/(?P<pk>\d+)/add-event$', views.agenda_add_event,
             name='chrono-manager-agenda-add-event'),
-        url(r'^agendas/(?P<pk>\w+)/import-events$', views.agenda_import_events,
+        url(r'^agendas/(?P<pk>\d+)/import-events$', views.agenda_import_events,
             name='chrono-manager-agenda-import-events'),
-        url(r'^events/(?P<pk>\w+)/$', views.event_edit,
+        url(r'^events/(?P<pk>\d+)/$', views.event_edit,
             name='chrono-manager-event-edit'),
-        url(r'^events/(?P<pk>\w+)/delete$', views.event_delete,
+        url(r'^events/(?P<pk>\d+)/delete$', views.event_delete,
             name='chrono-manager-event-delete'),
 
-        url(r'^agendas/(?P<pk>\w+)/add-meeting-type$', views.agenda_add_meeting_type,
+        url(r'^agendas/(?P<pk>\d+)/add-meeting-type$', views.agenda_add_meeting_type,
             name='chrono-manager-agenda-add-meeting-type'),
-        url(r'^meetingtypes/(?P<pk>\w+)/edit$', views.meeting_type_edit,
+        url(r'^meetingtypes/(?P<pk>\d+)/edit$', views.meeting_type_edit,
             name='chrono-manager-meeting-type-edit'),
-        url(r'^meetingtypes/(?P<pk>\w+)/delete$', views.meeting_type_delete,
+        url(r'^meetingtypes/(?P<pk>\d+)/delete$', views.meeting_type_delete,
             name='chrono-manager-meeting-type-delete'),
 
         url(r'^agendas/(?P<agenda_pk>\d+)/desk/(?P<pk>\d+)/add-time-period$', views.agenda_add_time_period,
             name='chrono-manager-agenda-add-time-period'),
-        url(r'^timeperiods/(?P<pk>\w+)/edit$', views.time_period_edit,
+        url(r'^timeperiods/(?P<pk>\d+)/edit$', views.time_period_edit,
             name='chrono-manager-time-period-edit'),
-        url(r'^timeperiods/(?P<pk>\w+)/delete$', views.time_period_delete,
+        url(r'^timeperiods/(?P<pk>\d+)/delete$', views.time_period_delete,
             name='chrono-manager-time-period-delete'),
 
-        url(r'^agendas/(?P<pk>\w+)/add-desk$', views.agenda_add_desk,
+        url(r'^agendas/(?P<pk>\d+)/add-desk$', views.agenda_add_desk,
             name='chrono-manager-agenda-add-desk'),
-        url(r'^desks/(?P<pk>\w+)/edit$', views.desk_edit,
+        url(r'^desks/(?P<pk>\d+)/edit$', views.desk_edit,
             name='chrono-manager-desk-edit'),
-        url(r'^desks/(?P<pk>\w+)/delete$', views.desk_delete,
+        url(r'^desks/(?P<pk>\d+)/delete$', views.desk_delete,
             name='chrono-manager-desk-delete'),
 
         url(r'^agendas/(?P<agenda_pk>\d+)/desk/(?P<pk>\d+)/add-time-period-exception$', views.agenda_add_time_period_exception,
             name='chrono-manager-agenda-add-time-period-exception'),
-        url(r'^agendas/desk/(?P<pk>\w+)/import-exceptions-from-ics/$', views.desk_import_time_period_exceptions,
+        url(r'^agendas/desk/(?P<pk>\d+)/import-exceptions-from-ics/$', views.desk_import_time_period_exceptions,
             name='chrono-manager-desk-add-import-time-period-exceptions'),
-        url(r'^time-period-exceptions/(?P<pk>\w+)/edit$', views.time_period_exception_edit,
+        url(r'^time-period-exceptions/(?P<pk>\d+)/edit$', views.time_period_exception_edit,
             name='chrono-manager-time-period-exception-edit'),
-        url(r'^time-period-exceptions/(?P<pk>\w+)/delete$', views.time_period_exception_delete,
+        url(r'^time-period-exceptions/(?P<pk>\d+)/delete$', views.time_period_exception_delete,
             name='chrono-manager-time-period-exception-delete'),
-        url(r'^time-period-exceptions/(?P<pk>\w+)/exception-list$', views.time_period_exception_list,
+        url(r'^time-period-exceptions/(?P<pk>\d+)/exception-list$', views.time_period_exception_list,
             name='chrono-manager-time-period-exception-list'),
 
         url(r'^agendas/events.csv$', views.agenda_import_events_sample_csv,
-- 
2.20.1

