summaryrefslogtreecommitdiffstats
path: root/core/views/statistics.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2025-06-30 12:15:09 +0300
committerPhilip Sargent <philip.sargent@gmail.com>2025-06-30 12:15:09 +0300
commit6c962c0132455bf4bff329856a790d83b935848f (patch)
treed7e59620d9c955c99e6f3a77169a41fc31047bab /core/views/statistics.py
parent8d901efdfcb81d1c4c04faa7ff6b2946fc7afe30 (diff)
downloadtroggle-master.tar.gz
troggle-master.tar.bz2
troggle-master.zip
correct totals without non-expo surveysHEADmaster
Diffstat (limited to 'core/views/statistics.py')
-rw-r--r--core/views/statistics.py7
1 files changed, 4 insertions, 3 deletions
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}))