From 6c962c0132455bf4bff329856a790d83b935848f Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Mon, 30 Jun 2025 12:15:09 +0300 Subject: correct totals without non-expo surveys --- core/views/statistics.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'core/views/statistics.py') diff --git a/core/views/statistics.py b/core/views/statistics.py index 8bd7072..30fc1b5 100644 --- a/core/views/statistics.py +++ b/core/views/statistics.py @@ -26,9 +26,10 @@ def legs_by_expo(expos): survexblocks = expedition.survexblock_set.all() legsyear = 0 survexleglength = 0.0 - for survexblock in survexblocks: - survexleglength += survexblock.legslength - legsyear += int(survexblock.legsall) + for sb in survexblocks: + if not sb.foreigners: + survexleglength += sb.legslength + legsyear += int(sb.legsall) addupsurvexlength += survexleglength addupsurvexlegs += legsyear legsbyexpo.append((expedition, {"nsurvexlegs": legsyear, "survexleglength": survexleglength})) -- cgit v1.2.3