pytask/profile/utils.py
changeset 470 68884c9b61e0
parent 420 920fb0dcc384
equal deleted inserted replaced
469:87f03c28f5de 470:68884c9b61e0
     7     """ if notification exists, and belongs to the current user, return it.
     7     """ if notification exists, and belongs to the current user, return it.
     8     else return None.
     8     else return None.
     9     """
     9     """
    10 
    10 
    11     user_notifications = user.notification_sent_to.filter(is_deleted=False).order_by('sent_date')
    11     user_notifications = user.notification_sent_to.filter(is_deleted=False).order_by('sent_date')
    12     current_notifications = user_notifications.filter(uniq_key=nid)
    12     current_notifications = user_notifications.filter(pk=nid)
    13     if user_notifications:
    13     if user_notifications:
    14         current_notification = current_notifications[0]
    14         current_notification = current_notifications[0]
    15 
    15 
    16         try:
    16         try:
    17             newer_notification = current_notification.get_next_by_sent_date(sent_to=user, is_deleted=False)
    17             newer_notification = current_notification.get_next_by_sent_date(sent_to=user, is_deleted=False)