mirror of
https://github.com/Hopiu/django-notifications.git
synced 2026-03-16 21:30:24 +00:00
Merge pull request #140 from osminogin/master
Redirect to unread view after mark notification as read
This commit is contained in:
commit
58786cf119
2 changed files with 4 additions and 4 deletions
|
|
@ -177,7 +177,7 @@ class NotificationTestPages(TestCase):
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue