Compare commits
No commits in common. "d82cea75e904114e3ba1e7af2f6ebd9182b9ed93" and "a6474e07e858400c771b706de151de79ab555878" have entirely different histories.
d82cea75e9
...
a6474e07e8
10
README.md
10
README.md
|
@ -2,12 +2,8 @@
|
||||||
|
|
||||||
purpose: gather data from intern(WMDE) and extern(volunteers) forms to create a database ('förderdatenbank') and send emails with links for a questionary.
|
purpose: gather data from intern(WMDE) and extern(volunteers) forms to create a database ('förderdatenbank') and send emails with links for a questionary.
|
||||||
|
|
||||||
Should be executed daily:
|
|
||||||
|
|
||||||
python manage.py sendmails
|
|
||||||
|
|
||||||
versions used in development:
|
versions used in development:
|
||||||
|
|
||||||
python 3.8.2
|
python 3.8.2
|
||||||
django 3.1.1
|
django 3.1.1
|
||||||
django-formtools 2.2
|
django-formtools 2.2
|
||||||
|
|
|
@ -4,7 +4,7 @@ from django.core.management.base import BaseCommand, CommandError
|
||||||
from django.template.loader import get_template
|
from django.template.loader import get_template
|
||||||
from django.core.mail import send_mail, BadHeaderError
|
from django.core.mail import send_mail, BadHeaderError
|
||||||
|
|
||||||
from input.models import Project, Library, HonoraryCertificate
|
from input.models import Project, Library
|
||||||
from input.settings import URLPREFIX, IF_EMAIL, SURVEYPREFIX
|
from input.settings import URLPREFIX, IF_EMAIL, SURVEYPREFIX
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
|
@ -13,13 +13,13 @@ class Command(BaseCommand):
|
||||||
- two weeks after confirmation of support for volunteer (/extern) send link
|
- two weeks after confirmation of support for volunteer (/extern) send link
|
||||||
with surveylink
|
with surveylink
|
||||||
|
|
||||||
- TODO: same for HonoraryCertificate (/intern)
|
- same for HonoraryCertificate and accreditation (/intern)
|
||||||
|
|
||||||
- TODO: travel: mail 3 weeks after end of project.
|
- travel: mail 3 weeks after end of project.
|
||||||
|
|
||||||
- assumed end of project (/project) reached: mail to IF, link to project-editpage
|
- assumed end of project (/project) reached: mail to IF, link to project-editpage
|
||||||
|
|
||||||
- TODO: 4 weeks after end of project reached: mail with surveylink
|
- 4 weeks after end of project reached: mail with surveylink
|
||||||
'''
|
'''
|
||||||
|
|
||||||
help = '''This command sends mail with some links to the database or to the survey
|
help = '''This command sends mail with some links to the database or to the survey
|
||||||
|
@ -86,18 +86,4 @@ class Command(BaseCommand):
|
||||||
item.survey_mail_send = True
|
item.survey_mail_send = True
|
||||||
item.save()
|
item.save()
|
||||||
|
|
||||||
# get all HonoraryCertificate objects which where granted two weeks ago
|
|
||||||
supported = HonoraryCertificate.objects.filter(granted=True)\
|
|
||||||
.filter(granted_date__lt = date.today() - timedelta(days=14))\
|
|
||||||
.exclude(survey_mail_send=True)
|
|
||||||
print(supported)
|
|
||||||
for item in supported:
|
|
||||||
self.survey_link(email=item.email,
|
|
||||||
type='HON',
|
|
||||||
pid=9999, ## TODO
|
|
||||||
name=item.request_url,
|
|
||||||
realname=item.realname)
|
|
||||||
item.survey_mail_send = True
|
|
||||||
item.save()
|
|
||||||
|
|
||||||
self.stdout.write(self.style.SUCCESS('sendmails custom command executed'))
|
self.stdout.write(self.style.SUCCESS('sendmails custom command executed'))
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
from datetime import date
|
|
||||||
|
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.forms import modelformset_factory
|
from django.forms import modelformset_factory
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
|
@ -89,8 +87,6 @@ class InternView(CookieWizardView):
|
||||||
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.granted = True
|
|
||||||
form.granted_date = date.today()
|
|
||||||
form.save()
|
form.save()
|
||||||
|
|
||||||
return done(self.request)
|
return done(self.request)
|
||||||
|
|
Loading…
Reference in New Issue