fix issue with editing and deleting phonebook numbers starting with one or more 0s, django would remove leading 0s because the url pattern was an int, use a regex expecting 4 digits instead

This commit is contained in:
Thomas Steen Rasmussen 2021-08-12 03:16:39 +02:00
parent ea5fa120b1
commit 816f1e5ace

View file

@ -1,4 +1,4 @@
from django.urls import include, path from django.urls import include, path, re_path
from .views import ( from .views import (
DectExportView, DectExportView,
@ -25,8 +25,8 @@ urlpatterns = [
DectRegistrationCreateView.as_view(), DectRegistrationCreateView.as_view(),
name="dectregistration_create", name="dectregistration_create",
), ),
path( re_path(
"<int:dect_number>/", r"^(?P<dect_number>\d{4})/",
include( include(
[ [
path( path(