From ffb90e206cebf75b159a3e42a7f5f86287fbabc0 Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Wed, 1 Jun 2011 12:39:09 +0200 Subject: create form from request only if there are any GET parameters diff --git a/nop/views.py b/nop/views.py index 712be84..4b43975 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'] -- cgit v0.10.2