Browse Source

just added some comments to clarify where we need to send which emails

master
Benni Baermann 4 years ago
parent
commit
cf50e1ef12
2 changed files with 18 additions and 1 deletions
  1. +13
    -0
      input/management/commands/sendmails.py
  2. +5
    -1
      input/views.py

+ 13
- 0
input/management/commands/sendmails.py View File

@ -1,7 +1,20 @@
from django.core.management.base import BaseCommand, CommandError from django.core.management.base import BaseCommand, CommandError
# mails must be send here:
#
# - two weeks after confirmation of support for volunteer (/extern) send link
# with surveylink
#
# - same for HonoraryCertificate and accreditation
#
# - travel: mail 3 weeks after end of project.
#
# - assumed end of project (/project) reached: mail to IF, link to project-editpage
#
class Command(BaseCommand): class Command(BaseCommand):
help = 'This command sends mail with surveylinks after some amount of time.' help = 'This command sends mail with surveylinks after some amount of time.'
def handle(self, *args, **options): def handle(self, *args, **options):
self.stdout.write(self.style.SUCCESS('sendmails custom command executed')) self.stdout.write(self.style.SUCCESS('sendmails custom command executed'))

+ 5
- 1
input/views.py View File

@ -82,12 +82,16 @@ class ExternView(CookieWizardView):
# write data to database # write data to database
form = form.save(commit=False) form = form.save(commit=False)
# this is ugly code. how can we copy this without explicit writing? # this is ugly code. how can we copy this without explicit writing?
# i found no way to access the ModelForm.Meta.exclude-array
# i found no way to access the ModelForm.Meta.exclude-tupel
form.realname = data['realname'] form.realname = data['realname']
form.username = data['username'] form.username = data['username']
form.email = data['email'] form.email = data['email']
form.save() form.save()
# we need to send the following mails here:
# - mail with entered data to the Volunteer
# - mail to IF with link to accept/decline
return done(self.request) return done(self.request)
# return render(self.request, 'saved', { # return render(self.request, 'saved', {
# 'form_data': [form.cleaned_data for form in form_list], # 'form_data': [form.cleaned_data for form in form_list],

Loading…
Cancel
Save