Skip to content
Browse files

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...
1 parent 8f38e23 commit 1b4df0a380836de0209db07491c2ac688741249b @mcroydon mcroydon committed with brosner Dec 22, 2009
Showing with 5 additions and 1 deletion.
  1. +1 −0 CHANGELOG
  2. +4 −1 notification/views.py
View
1 CHANGELOG
@@ -9,6 +9,7 @@ BI = backward incompatible change
* BI: added nullable Notice.sender and modified send_now and queue to take
an optional sender
* added received and sent methods taking a User instance to Notice.objects
+ * New default behavior: single notice view now marks unseen notices as seen
0.1.5
-----
View
5 notification/views.py
@@ -47,9 +47,12 @@ def notices(request):
}, context_instance=RequestContext(request))
@login_required
-def single(request, id):
+def single(request, id, mark_seen=True):
notice = get_object_or_404(Notice, id=id)
if request.user == notice.user:
+ if mark_seen and notice.unseen:
+ notice.unseen = False
+ notice.save()
return render_to_response("notification/single.html", {
"notice": notice,
}, context_instance=RequestContext(request))

0 comments on commit 1b4df0a

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