From 4ccbb4bef309571159c9558cca5da04987a68646 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 22 Oct 2012 00:08:24 +0200 Subject: Djangoization - Major refactoring (step 15) * works on dashboards --- archaeological_operations/models.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'archaeological_operations/models.py') diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 831190342..082a0072d 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -645,6 +645,8 @@ class OperationDashboard: cost_means, cost_sums = [], [] for idx, year in enumerate(years): vals = [r_years[idx] for lbl, r_years in dct_res[res_key]] + if not vals: + continue sum_area = sum([a for a, c in vals]) sum_cost = sum([c for a, c in vals]) area_means.append(sum_area/len(vals)) -- cgit v1.2.3