From 2bb8ee517de03e7bf712eea0216ea3e3a301e863 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Thu, 22 Oct 2020 10:53:40 +0200 Subject: [PATCH] database change link to end of project mail added --- input/management/commands/sendmails.py | 3 ++- input/templates/input/if_end_of_project.txt | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/input/management/commands/sendmails.py b/input/management/commands/sendmails.py index 9366316..35112ce 100644 --- a/input/management/commands/sendmails.py +++ b/input/management/commands/sendmails.py @@ -31,6 +31,8 @@ class Command(BaseCommand): mail_template = get_template('input/if_end_of_project.txt') for project in old: context = {'project': project} + context['URLPREFIX'] = URLPREFIX + print(context) try: send_mail('Projektende erreicht', mail_template.render(context), @@ -40,5 +42,4 @@ class Command(BaseCommand): except BadHeaderError: return HttpResponse('Invalid header found.') - self.stdout.write(self.style.SUCCESS('sendmails custom command executed')) diff --git a/input/templates/input/if_end_of_project.txt b/input/templates/input/if_end_of_project.txt index 3c3dd50..4acf424 100644 --- a/input/templates/input/if_end_of_project.txt +++ b/input/templates/input/if_end_of_project.txt @@ -1,9 +1,10 @@ Hallo Team Ideenförderung! -Das Project {{project.name}} hat am {{project.end}} sein vorraussichtliches Ende erreicht. +Das Project {{project.name}} hat am {{project.end}} sein vorraussichtliches +Ende erreicht. Hier könnt ihr es in der Datenbank editieren: -INSERT LINK here ID: {{project.pid}} +{{URLPREFIX}}/admin/input/project/{{project.pk}}/change mit freundlichen Grüßen, Eure Lieblingsdatenbank