From 9c23d8bdddd4f62a380fb916f11e81e75ac7a027 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Mon, 8 Feb 2021 09:12:56 +0100 Subject: [PATCH] BUGFIX: survey mails for project and travel should be sent after project end not after granted_date --- input/management/commands/sendmails.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/input/management/commands/sendmails.py b/input/management/commands/sendmails.py index b159639..4790531 100644 --- a/input/management/commands/sendmails.py +++ b/input/management/commands/sendmails.py @@ -124,7 +124,7 @@ class Command(BaseCommand): def surveymails_to_project(self): '''send survey link 4 weeks after end of project reached''' supported = Project.objects.filter(granted=True)\ - .filter(granted_date__lt = date.today() - timedelta(days=28))\ + .filter(end__lt = date.today() - timedelta(days=28))\ .exclude(survey_mail_send=True) self.surveymails_to_object(supported, type='PRO', name='realname') @@ -132,7 +132,7 @@ class Command(BaseCommand): '''send survey link 3 weeks after end of project reached''' supported = Travel.objects.filter(project__granted=True)\ - .filter(project__granted_date__lt = date.today() - timedelta(days=21))\ + .filter(project__end__lt = date.today() - timedelta(days=21))\ .exclude(survey_mail_send=True) self.surveymails_to_object(supported, type='TRAV', name='request_url')