Fixing method total_closed_points_by_date for milestone model
parent
922571c56b
commit
8c3fed2088
|
@ -133,7 +133,11 @@ class Milestone(WatchedModelMixin, models.Model):
|
||||||
# for that date
|
# for that date
|
||||||
# This calulation is the total user story points divided by its number of tasks
|
# This calulation is the total user story points divided by its number of tasks
|
||||||
for task in tasks:
|
for task in tasks:
|
||||||
user_story = user_stories[task.user_story.id]
|
user_story = user_stories.get(task.user_story.id, None)
|
||||||
|
if user_story is None:
|
||||||
|
total_us_points = 0
|
||||||
|
us_tasks_counter = 0
|
||||||
|
else:
|
||||||
total_us_points = user_story._total_us_points
|
total_us_points = user_story._total_us_points
|
||||||
us_tasks_counter = user_story.num_tasks
|
us_tasks_counter = user_story.num_tasks
|
||||||
|
|
||||||
|
@ -144,7 +148,9 @@ class Milestone(WatchedModelMixin, models.Model):
|
||||||
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 = self._total_closed_points_by_date.get(finished_date, 0)
|
||||||
|
if us_tasks_counter != 0:
|
||||||
points_by_date += total_us_points / us_tasks_counter
|
points_by_date += total_us_points / us_tasks_counter
|
||||||
|
|
||||||
self._total_closed_points_by_date[finished_date] = points_by_date
|
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
|
# At this point self._total_closed_points_by_date keeps a dict where the
|
||||||
|
|
Loading…
Reference in New Issue