X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/1c6b6f643fb3a9f50fe2752b3b2ee3390b321d78..739f5e011528ab0651f67be7e40daf8e48cb3764:/edumed/contact_forms.py diff --git a/edumed/contact_forms.py b/edumed/contact_forms.py index 87fc591..7e7faca 100644 --- a/edumed/contact_forms.py +++ b/edumed/contact_forms.py @@ -239,7 +239,7 @@ class CommissionForm(forms.Form): class OlimpiadaForm(ContactForm): - disabled = False + disabled = True disabled_template = 'wtem/disabled_contact_form.html' form_tag = "olimpiada" form_title = u"Olimpiada Cyfrowa - Elektroniczny System Zgłoszeń" @@ -276,7 +276,8 @@ class OlimpiadaForm(ContactForm): @staticmethod def get_extract_fields(contact, extract_type_slug): fields = contact.body.keys() - fields.remove('student') + if 'student' in fields: + fields.remove('student') fields.extend(['contact', 'student_first_name', 'student_last_name', 'student_email']) return fields @@ -293,12 +294,13 @@ class OlimpiadaForm(ContactForm): toret[0][field_name] = val current = toret[0] - for student in contact.body['student']: - for attr in ('first_name', 'last_name', 'email'): - current['student_' + attr] = student[attr] - if current not in toret: - toret.append(current) - current = {} + if 'student' in contact.body: + for student in contact.body['student']: + for attr in ('first_name', 'last_name', 'email'): + current['student_' + attr] = student[attr] + if current not in toret: + toret.append(current) + current = {} return toret def save(self, request, formsets=None): @@ -533,6 +535,7 @@ class CybernauciForm(ContactForm): class WLEMForm(ContactForm): + disabled = True form_tag = 'wlem' form_title = u"WLEM - szkolenie dla warszawskich liderów edukacji medialnej" admin_list = ['nazwisko', 'instytucja', 'contact']