profile/views.py
changeset 276 c8c47fcb46f0
parent 275 c701e68f8d35
child 282 69d1c4b99503
equal deleted inserted replaced
275:c701e68f8d35 276:c8c47fcb46f0
    55     context = {'user':user,
    55     context = {'user':user,
    56                'notifications':active_notifications,
    56                'notifications':active_notifications,
    57               }                               
    57               }                               
    58 
    58 
    59     return render_to_response('profile/browse_notifications.html', context)
    59     return render_to_response('profile/browse_notifications.html', context)
       
    60 
       
    61 @login_required
       
    62 def view_notification(request, nid):
       
    63     """ get the notification depending on nid.
       
    64     Display it.
       
    65     """
       
    66 
       
    67     user = get_user(request.user)
       
    68     newest, newer, notification, older, oldest =
       
    69     get_notification(nid, user)
       
    70 
       
    71     if not notification:
       
    72         raise Http404
       
    73 
       
    74     notification.is_read = True
       
    75     notification.save()
       
    76 
       
    77     context = {'user':user,
       
    78                'notification':notification,
       
    79                'newest':newest,
       
    80                'newer':newer,
       
    81                'older':older,
       
    82                'oldest':oldest,
       
    83               }
       
    84 
       
    85     return render_to_response('profile/view_notification.html', context)