From db84146fd291bfa7a9209939348b7932eefa3a06 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Tue, 12 Nov 2013 09:24:58 +0100 Subject: [PATCH 1/1] disable wtem registration --- contact/views.py | 2 ++ edumed/contact_forms.py | 1 + 2 files changed, 3 insertions(+) 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" -- 2.20.1