From 85ebdd3ba0f7510d785239e61f822d6aff25cf1c Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Date: Fri, 8 Jun 2018 11:40:34 +0200
Subject: [PATCH] removed filter form if no results
---
rowers/templates/virtualevent.html | 3 +++
rowers/views.py | 7 +++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/rowers/templates/virtualevent.html b/rowers/templates/virtualevent.html
index 8968233f..c1e22e52 100644
--- a/rowers/templates/virtualevent.html
+++ b/rowers/templates/virtualevent.html
@@ -242,6 +242,8 @@
{{ coursescript|safe }}
+
+ {% if form %}
Filter Results
@@ -253,6 +255,7 @@
{% csrf_token %}
+ {% endif %}
diff --git a/rowers/views.py b/rowers/views.py
index 78020904..54c9f3ed 100644
--- a/rowers/views.py
+++ b/rowers/views.py
@@ -13718,8 +13718,11 @@ def virtualevent_view(request,id=0):
workoutid__isnull=False,
).order_by("duration")
- form = RaceResultFilterForm(records=records)
-
+ if results:
+ form = RaceResultFilterForm(records=records)
+ else:
+ form = None
+
# to-do - add DNS
dns = []
if timezone.now() > race.evaluation_closure: