summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Raggam <raggam-nl@adm.at>2011-06-01 10:39:09 (GMT)
committerJohannes Raggam <raggam-nl@adm.at>2011-06-01 10:39:09 (GMT)
commitffb90e206cebf75b159a3e42a7f5f86287fbabc0 (patch)
tree0d57b67ba1a357f04d6c923beb01883b054bc8e0
parentb0fc7daaaede72ceb38c00115b0a79fb600137d7 (diff)
create form from request only if there are any GET parameters
-rw-r--r--nop/views.py3
1 files changed, 2 insertions, 1 deletions
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']