|
@ -7,7 +7,7 @@ from django.conf import settings |
|
|
from django.template.loader import get_template |
|
|
from django.template.loader import get_template |
|
|
from django.template import Context |
|
|
from django.template import Context |
|
|
|
|
|
|
|
|
from .forms import ProjectForm, VolunteerForm, LibraryForm, IFGForm,\ |
|
|
|
|
|
|
|
|
from .forms import ProjectForm, ExternForm, LibraryForm, IFGForm,\ |
|
|
HonoraryCertificateForm, InternForm, TravelForm |
|
|
HonoraryCertificateForm, InternForm, TravelForm |
|
|
from .models import Project, TYPE_CHOICES, Library |
|
|
from .models import Project, TYPE_CHOICES, Library |
|
|
from .settings import URLPREFIX, IF_EMAIL |
|
|
from .settings import URLPREFIX, IF_EMAIL |
|
@ -72,7 +72,7 @@ class InternView(CookieWizardView): |
|
|
return form |
|
|
return form |
|
|
|
|
|
|
|
|
def done(self, form_list, **kwargs): |
|
|
def done(self, form_list, **kwargs): |
|
|
print('ExternView.done() reached') |
|
|
|
|
|
|
|
|
print('InternView.done() reached') |
|
|
# gather data from all forms |
|
|
# gather data from all forms |
|
|
data = {} |
|
|
data = {} |
|
|
for form in form_list: |
|
|
for form in form_list: |
|
@ -85,7 +85,7 @@ class InternView(CookieWizardView): |
|
|
# 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-tupel |
|
|
# 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() |
|
|
|
|
|
|
|
@ -96,7 +96,7 @@ class ExternView(CookieWizardView): |
|
|
'''This View is for Volunteers''' |
|
|
'''This View is for Volunteers''' |
|
|
|
|
|
|
|
|
template_name = "input/extern.html" |
|
|
template_name = "input/extern.html" |
|
|
form_list = [VolunteerForm, LibraryForm] |
|
|
|
|
|
|
|
|
form_list = [ExternForm, LibraryForm] |
|
|
|
|
|
|
|
|
def get_form(self, step=None, data=None, files=None): |
|
|
def get_form(self, step=None, data=None, files=None): |
|
|
'''this function determines which part of the multipart form is |
|
|
'''this function determines which part of the multipart form is |
|
@ -135,7 +135,7 @@ class ExternView(CookieWizardView): |
|
|
# we have to copy the data from the first form here |
|
|
# we have to copy the data from the first form here |
|
|
# this is a bit ugly code. how can we copy this without explicit writing? |
|
|
# this is a bit ugly code. how can we copy this without explicit writing? |
|
|
form.realname = data['realname'] |
|
|
form.realname = data['realname'] |
|
|
form.username = data['username'] |
|
|
|
|
|
|
|
|
# form.username = data['username'] |
|
|
form.email = data['email'] |
|
|
form.email = data['email'] |
|
|
# write type of form in some cases |
|
|
# write type of form in some cases |
|
|
if data['choice'] in ('BIB', 'ELIT', 'SOFT'): |
|
|
if data['choice'] in ('BIB', 'ELIT', 'SOFT'): |
|
|