Skip to content
This repository
Browse code

New default behavior: added optional mark_seen keyword argument to si…

…ngle notice view. When enabled (default) it will mark the notice as seen if it's not set already.
  • Loading branch information...
commit 1b4df0a380836de0209db07491c2ac688741249b 1 parent 8f38e23
Matt Croydon mcroydon authored brosner committed

Showing 2 changed files with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. +1 0  CHANGELOG
  2. +4 1 notification/views.py
1  CHANGELOG
@@ -9,6 +9,7 @@ BI = backward incompatible change
9 9 * BI: added nullable Notice.sender and modified send_now and queue to take
10 10 an optional sender
11 11 * added received and sent methods taking a User instance to Notice.objects
  12 + * New default behavior: single notice view now marks unseen notices as seen
12 13
13 14 0.1.5
14 15 -----
5 notification/views.py
@@ -47,9 +47,12 @@ def notices(request):
47 47 }, context_instance=RequestContext(request))
48 48
49 49 @login_required
50   -def single(request, id):
  50 +def single(request, id, mark_seen=True):
51 51 notice = get_object_or_404(Notice, id=id)
52 52 if request.user == notice.user:
  53 + if mark_seen and notice.unseen:
  54 + notice.unseen = False
  55 + notice.save()
53 56 return render_to_response("notification/single.html", {
54 57 "notice": notice,
55 58 }, context_instance=RequestContext(request))

0 comments on commit 1b4df0a

Please sign in to comment.
Something went wrong with that request. Please try again.