summaryrefslogtreecommitdiff
path: root/archaeological_operations/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2012-10-22 00:08:24 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2012-10-22 00:08:24 +0200
commit5b773f6a3cc454e26693b83169760369cf0a0b62 (patch)
tree3bedb956e0505accf622a6c42c94f3e613286bd6 /archaeological_operations/models.py
parenta82ae23015f8036919bae3c4a4e133e9045e6fcc (diff)
downloadIshtar-5b773f6a3cc454e26693b83169760369cf0a0b62.tar.bz2
Ishtar-5b773f6a3cc454e26693b83169760369cf0a0b62.zip
Djangoization - Major refactoring (step 15)
* works on dashboards
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r--archaeological_operations/models.py2
1 files changed, 2 insertions, 0 deletions
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))