From aa77c3f5ec34460a6393b7ef4e3842477968dff3 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Mon, 26 Jun 2017 09:40:31 +0200 Subject: [PATCH] Use empty timedelta for computing duration when effort is empty issue6589 review41401002 --- work.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/work.py b/work.py index f9ca0b91a6..e972c18bc9 100644 --- a/work.py +++ b/work.py @@ -110,14 +110,14 @@ class Work: leafs.add(work.id) total_allocation = 0 + effort = work.effort_duration or datetime.timedelta() if not work.allocations: - durations[work.id] = (work.effort_duration - or datetime.timedelta()) + durations[work.id] = effort continue for allocation in work.allocations: total_allocation += allocation.percentage durations[work.id] = datetime.timedelta( - seconds=work.effort_duration.total_seconds() + seconds=effort.total_seconds() / (total_allocation / 100.0)) while leafs: