make sure we always get numeric values

This commit is contained in:
Helmut Merz 2017-12-07 18:26:27 +01:00
parent 8c29a3e7d4
commit 4b49fda269
2 changed files with 2 additions and 1 deletions

View file

@ -236,7 +236,7 @@ The user interface is a ReportConceptView subclass that is directly associated w
{'actions': [...]} {'actions': [...]}
>>> results.totals.data >>> results.totals.data
{'effort': 900} {'effort': 900.0}
Export of work data Export of work data
------------------- -------------------

View file

@ -75,6 +75,7 @@ class DurationField(Field):
def getValue(self, row): def getValue(self, row):
value = self.getRawValue(row) or 0 value = self.getRawValue(row) or 0
value = float(value)
if value and 'totals' in self.executionSteps: if value and 'totals' in self.executionSteps:
data = row.parent.totals.data data = row.parent.totals.data
data[self.name] = data.get(self.name, 0) + value data[self.name] = data.get(self.name, 0) + value