From 0ce0151b162aede4928ce55cb87f393cc192a0bf Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Thu, 22 Oct 2020 16:08:11 +0200 Subject: [PATCH] use Library.granted_date in sendmails command --- input/management/commands/sendmails.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/input/management/commands/sendmails.py b/input/management/commands/sendmails.py index 49ced69..9cd8440 100644 --- a/input/management/commands/sendmails.py +++ b/input/management/commands/sendmails.py @@ -46,7 +46,6 @@ class Command(BaseCommand): def end_of_projects_reached(self): ''' end of project reached ''' # get all projects which ended - # - timedelta(days=21)) old = Project.objects.filter(end__lt = date.today())\ .exclude(end_mail_send = True) @@ -73,7 +72,9 @@ class Command(BaseCommand): self.end_of_projects_reached() + # get all library objects which where granted two weeks ago supported = Library.objects.filter(granted=True)\ + .filter(granted_date__lt = date.today() - timedelta(days=14))\ .exclude(survey_mail_send=True) print(supported) for item in supported: