From cf0a11d7754bc01ff082b4e435cc69f681c60d69 Mon Sep 17 00:00:00 2001 From: Aaron Zhao Date: Tue, 1 Aug 2017 14:48:08 +0800 Subject: [PATCH] update queryset methods mark_as_sent() and mark_as_unsent() --- notifications/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/notifications/models.py b/notifications/models.py index 7d39196..6e470dd 100644 --- a/notifications/models.py +++ b/notifications/models.py @@ -125,11 +125,13 @@ class NotificationQuerySet(models.query.QuerySet): return qs.update(deleted=False) def mark_as_unsent(self, recipient=None): + qs = self.sent() if recipient: qs = self.filter(recipient=recipient) return qs.update(emailed=False) def mark_as_sent(self, recipient=None): + qs = self.unsent() if recipient: qs = self.filter(recipient=recipient) return qs.update(emailed=True)