1
0
Fork 0

use Library.granted_date in sendmails command

This commit is contained in:
Benni Bärmann 2020-10-22 16:08:11 +02:00
parent bb2b40e50d
commit 0ce0151b16
1 changed files with 2 additions and 1 deletions

View File

@ -46,7 +46,6 @@ class Command(BaseCommand):
def end_of_projects_reached(self): def end_of_projects_reached(self):
''' end of project reached ''' ''' end of project reached '''
# get all projects which ended # get all projects which ended
# - timedelta(days=21))
old = Project.objects.filter(end__lt = date.today())\ old = Project.objects.filter(end__lt = date.today())\
.exclude(end_mail_send = True) .exclude(end_mail_send = True)
@ -73,7 +72,9 @@ class Command(BaseCommand):
self.end_of_projects_reached() self.end_of_projects_reached()
# get all library objects which where granted two weeks ago
supported = Library.objects.filter(granted=True)\ supported = Library.objects.filter(granted=True)\
.filter(granted_date__lt = date.today() - timedelta(days=14))\
.exclude(survey_mail_send=True) .exclude(survey_mail_send=True)
print(supported) print(supported)
for item in supported: for item in supported: