From c7fd00a0f394ee08ee857f0f5dc48ac1eb5f2aaf Mon Sep 17 00:00:00 2001 From: Vladimir Osintsev Date: Sat, 13 Aug 2016 23:46:04 +0300 Subject: [PATCH 1/2] Redirect to unread view after mark as read --- notifications/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/notifications/views.py b/notifications/views.py index c99edf8b..a7dcef99 100644 --- a/notifications/views.py +++ b/notifications/views.py @@ -63,7 +63,7 @@ def mark_all_as_read(request): if _next: return redirect(_next) - return redirect('notifications:all') + return redirect('notifications:unread') @login_required @@ -79,7 +79,7 @@ def mark_as_read(request, slug=None): if _next: return redirect(_next) - return redirect('notifications:all') + return redirect('notifications:unread') @login_required @@ -95,7 +95,7 @@ def mark_as_unread(request, slug=None): if _next: return redirect(_next) - return redirect('notifications:all') + return redirect('notifications:unread') @login_required From feeec2c28bd49ad7645637d87d983280fb281af4 Mon Sep 17 00:00:00 2001 From: Vladimir Osintsev Date: Sun, 14 Aug 2016 10:53:12 +0300 Subject: [PATCH 2/2] Fix test_unread_messages_pages test --- notifications/tests/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notifications/tests/tests.py b/notifications/tests/tests.py index 99ccf9ae..336bc5af 100644 --- a/notifications/tests/tests.py +++ b/notifications/tests/tests.py @@ -177,7 +177,7 @@ def test_unread_messages_pages(self): self.assertTrue(len(response.context['notifications']) < self.message_count) response = self.client.get(reverse('notifications:mark_all_as_read')) - self.assertRedirects(response, reverse('notifications:all')) + self.assertRedirects(response, reverse('notifications:unread')) response = self.client.get(reverse('notifications:unread')) self.assertEqual(len(response.context['notifications']), len(self.to_user.notifications.unread())) self.assertEqual(len(response.context['notifications']), 0)