From 825ca74311e0ca1fc092a877ac61c6abcae48c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Tue, 24 Oct 2017 16:49:55 +0200 Subject: [PATCH] Fix #5238: Milestone burndown graph take into account empty user stories --- taiga/projects/milestones/models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/taiga/projects/milestones/models.py b/taiga/projects/milestones/models.py index 39c125e1..f71844d3 100644 --- a/taiga/projects/milestones/models.py +++ b/taiga/projects/milestones/models.py @@ -149,6 +149,17 @@ class Milestone(WatchedModelMixin, models.Model): self._total_closed_points_by_date[finished_date] = points_by_date + for us in self.cached_user_stories: + if us.num_tasks > 0 or us.finish_date is None: + continue + finished_date = us.finish_date.date() + if finished_date < self.estimated_start: + finished_date = self.estimated_start + points_by_date = self._total_closed_points_by_date.get(finished_date, 0) + points_by_date += us._total_us_points + self._total_closed_points_by_date[finished_date] = points_by_date + + # At this point self._total_closed_points_by_date keeps a dict where the # finished date of the task is the key and the value is the increment of points # We are transforming this dict of increments in an acumulation one including