From 7cf8c74e7cbd36c2b75f4d9736e3daec1d5f9714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Albert?= Date: Wed, 13 May 2015 10:43:53 +0200 Subject: [PATCH] Fixed bugs in reporting when no data was received Change-Id: I49de5a40fc13042b376f374b68373db2678a252e --- .../dashboards/project/reporting/views.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/cloudkittydashboard/dashboards/project/reporting/views.py b/cloudkittydashboard/dashboards/project/reporting/views.py index 00e031a..60cf2de 100644 --- a/cloudkittydashboard/dashboards/project/reporting/views.py +++ b/cloudkittydashboard/dashboards/project/reporting/views.py @@ -52,13 +52,12 @@ def _do_this_month(data): service_names = services.keys() t = start_timestamp - while True: - if t > end_timestamp: - break - for service in service_names: - hourly_d = services[service]['hourly'] - hourly_d.setdefault(t, 0) - t += 3600 + if end_timestamp: + while t <= end_timestamp: + for service in service_names: + hourly_d = services[service]['hourly'] + hourly_d.setdefault(t, 0) + t += 3600 # now sort the dicts for service in service_names: @@ -88,7 +87,7 @@ class CostRepartitionTab(tabs.Tab): class ReportingTabs(tabs.TabGroup): slug = "reporting_tabs" - tabs = (CostRepartitionTab) + tabs = (CostRepartitionTab, ) sticky = True