|
|
@ -6,9 +6,11 @@ from django.core.mail import send_mail, BadHeaderError |
|
|
|
from django.conf import settings |
|
|
|
from django.template.loader import get_template |
|
|
|
from django.template import Context |
|
|
|
# from django.contrib.sites.models import Site |
|
|
|
|
|
|
|
from .forms import ProjectForm, VolunteerForm, LibraryForm, IFGForm |
|
|
|
from .models import Project, TYPE_CHOICES, Library |
|
|
|
from .settings import URLPREFIX, IF_EMAIL |
|
|
|
|
|
|
|
|
|
|
|
def set_granted_in_lib(key,b): |
|
|
@ -123,8 +125,9 @@ class ExternView(CookieWizardView): |
|
|
|
form.type = data['choice'] |
|
|
|
form.save() |
|
|
|
|
|
|
|
# add primary key to context |
|
|
|
# add some data to context for mail templates |
|
|
|
data['pk'] = form.pk |
|
|
|
data['urlprefix'] = URLPREFIX |
|
|
|
|
|
|
|
# we need to send the following mails here: |
|
|
|
context = { 'data': data } |
|
|
@ -134,7 +137,7 @@ class ExternView(CookieWizardView): |
|
|
|
send_mail( |
|
|
|
'form filled', |
|
|
|
mail_template.render(context), |
|
|
|
settings.IF_EMAIL, |
|
|
|
IF_EMAIL, |
|
|
|
[form.email], |
|
|
|
fail_silently=False, |
|
|
|
) |
|
|
@ -143,8 +146,8 @@ class ExternView(CookieWizardView): |
|
|
|
send_mail( |
|
|
|
'form filled', |
|
|
|
mail_template.render(context), |
|
|
|
settings.IF_EMAIL, |
|
|
|
[settings.IF_EMAIL], |
|
|
|
IF_EMAIL, |
|
|
|
[IF_EMAIL], |
|
|
|
fail_silently=False, |
|
|
|
) |
|
|
|
|
|
|
|