Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect to unread view after mark notification as read #140

Merged
merged 2 commits into from
Aug 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion notifications/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions notifications/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down