[perf-web] Fix startup with no data



commit 18ae6e9d48b41a72dcd8f282e5916c895d76a431
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Tue Jul 22 20:35:24 2014 -0400

    Fix startup with no data

 metrics/views.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/metrics/views.py b/metrics/views.py
index 2040b9e..beb4b92 100644
--- a/metrics/views.py
+++ b/metrics/views.py
@@ -30,6 +30,8 @@ def home(request):
     t = loader.get_template('metrics/home.html')
 
     time_range = Report.objects.aggregate(min=Min('pull_time'), max=Max('pull_time'));
+    if time_range['min'] is None:
+        time_range['min'] = time_range['max'] = datetime.now()
 
     c = Context({
         'page_name': 'home',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]