diff --git a/templates/header.html b/templates/header.html index 654348c943..630c8b849c 100644 --- a/templates/header.html +++ b/templates/header.html @@ -260,7 +260,7 @@
{% trans 'Voulez-vous vraiment marquer toutes vos notifications comme lues ?' %} diff --git a/zds/notification/tests/tests_basics.py b/zds/notification/tests/tests_basics.py index fec5604b2e..45353a5ebf 100644 --- a/zds/notification/tests/tests_basics.py +++ b/zds/notification/tests/tests_basics.py @@ -949,7 +949,7 @@ def test_mark_notifications_as_read(self): self.assertFalse(topic.is_read) - result = self.client.post(reverse("mark-notifications-as-read"), follow=False) + result = self.client.post(reverse("notification:mark-as-read"), follow=False) self.assertEqual(result.status_code, 302) notifications = Notification.objects.get_unread_notifications_of(self.user1) diff --git a/zds/notification/urls.py b/zds/notification/urls.py index f6a0e850a5..fc1c93be90 100644 --- a/zds/notification/urls.py +++ b/zds/notification/urls.py @@ -1,8 +1,10 @@ -from django.urls import re_path +from django.urls import path from zds.notification.views import NotificationList, mark_notifications_as_read +app_name = "notification" + urlpatterns = [ - re_path(r"^$", NotificationList.as_view(), name="notification-list"), - re_path(r"^marquer-comme-lues/$", mark_notifications_as_read, name="mark-notifications-as-read"), + path("", NotificationList.as_view(), name="list"), + path("marquer-comme-lues/", mark_notifications_as_read, name="mark-as-read"), ] diff --git a/zds/notification/views.py b/zds/notification/views.py index b4b1889065..8ff07b0839 100644 --- a/zds/notification/views.py +++ b/zds/notification/views.py @@ -64,4 +64,4 @@ def mark_notifications_as_read(request): messages.success(request, _("Vos notifications ont bien été marquées comme lues.")) - return redirect(reverse("notification-list")) + return redirect(reverse("notification:list")) diff --git a/zds/urls.py b/zds/urls.py index a7768b0631..885e4af975 100644 --- a/zds/urls.py +++ b/zds/urls.py @@ -91,7 +91,7 @@ def location(self, item): re_path(r"^rechercher/", include(("zds.searchv2.urls", "zds.searchv2"), namespace="search")), path("munin/", include(("zds.munin.urls", ""))), path("mise-en-avant/", include("zds.featured.urls")), - re_path(r"^notifications/", include(("zds.notification.urls", ""))), + path("notifications/", include("zds.notification.urls")), path("", include(("social_django.urls", "social_django"), namespace="social")), re_path(r"^munin/", include(("munin.urls", "munin"))), re_path(r"^$", home_view, name="homepage"),