From ffb90e206cebf75b159a3e42a7f5f86287fbabc0 Mon Sep 17 00:00:00 2001 From: Johannes Raggam <raggam-nl@adm.at> Date: Wed, 1 Jun 2011 12:39:09 +0200 Subject: [PATCH] create form from request only if there are any GET parameters --- nop/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nop/views.py b/nop/views.py index 712be848..4b439757 100644 --- a/nop/views.py +++ b/nop/views.py @@ -122,7 +122,8 @@ def nop_form(request): #context.update(csrf(request)) # in django template: {% csrf_token %} date = None time = None - if request.method == 'GET': + if request.method == 'GET' and\ + ('date' in request.GET or 'time' in request.GET): form = NopForm(request.GET) if form.is_valid(): date = form.cleaned_data['date'] -- GitLab