equal
deleted
inserted
replaced
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) |