From e9917fd2aad039064a3c0f4c78524fb02afea3ad Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Fri, 1 Nov 2019 22:15:08 +0100 Subject: [PATCH] contacts: Don't mix contacts and contactsraw The template personal/list is used by contacts and contactsraw. However the group filter uses the absolut url {% url 'contacts' %} which jumps back to reverse mapping of "contacts". Additionally, "name="contacts" was registered for both urlpatterns /contacts and /contactsraw, so it resolves to /contactsraw. This makes us effectively jump to contactsraw whenever the group filter is changed. Give /contacts and /contactsraw urlpatterns different name attributes. Use relative URLs with just a replaced query string for the group filter links. --- config/urls.py | 2 +- mpicms/templates/personal/list.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/urls.py b/config/urls.py index a11bce0..e728874 100644 --- a/config/urls.py +++ b/config/urls.py @@ -44,7 +44,7 @@ path('api/v2/', api_router.urls), path('logout', LogoutView.as_view(), name='logout'), path('contacts/', ContactListView.as_view(), name='contacts'), - path('contactsraw/', RawContactListView.as_view(), name='contacts'), + path('contactsraw/', RawContactListView.as_view(), name='contactsraw'), path('events/ics', ics_view, name='ics') ] + static( diff --git a/mpicms/templates/personal/list.html b/mpicms/templates/personal/list.html index 792daf5..a4bc5ef 100644 --- a/mpicms/templates/personal/list.html +++ b/mpicms/templates/personal/list.html @@ -18,13 +18,13 @@

{% trans 'Contact List' %}