mirror of
https://github.com/Hopiu/django-notifications.git
synced 2026-04-05 14:30:57 +00:00
update queryset methods mark_as_sent() and mark_as_unsent()
This commit is contained in:
parent
aeb89dc273
commit
cf0a11d775
1 changed files with 2 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue