From: Aleksander Łukasz Date: Tue, 12 Nov 2013 08:24:58 +0000 (+0100) Subject: disable wtem registration X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/db84146fd291bfa7a9209939348b7932eefa3a06?ds=inline disable wtem registration --- diff --git a/contact/views.py b/contact/views.py index 245433e..9fc9637 100644 --- a/contact/views.py +++ b/contact/views.py @@ -12,6 +12,8 @@ def form(request, form_tag): form_class = contact_forms[form_tag] except KeyError: raise Http404 + if getattr(form_class, 'disabled', False): + raise Http404 if request.method == 'POST': form = form_class(request.POST, request.FILES) formsets = [] diff --git a/edumed/contact_forms.py b/edumed/contact_forms.py index 8d3131e..ad19702 100644 --- a/edumed/contact_forms.py +++ b/edumed/contact_forms.py @@ -101,6 +101,7 @@ class NoEmptyFormsAllowedBaseFormSet(forms.formsets.BaseFormSet): raise forms.ValidationError(u"Proszę podać dane przynajmniej jednego ucznia.") class WTEMForm(ContactForm): + disabled = True form_tag = "wtem" form_title = u"WTEM - rejestracja uczestników" submit_label = u"Wyślij zgłoszenie"