From 8de17d772c0dbef8b1b88d5d5abd3a532178f9eb Mon Sep 17 00:00:00 2001 From: Sijmen Schoon Date: Thu, 5 Apr 2018 10:11:48 +0200 Subject: [PATCH] Work around Pivotal sometimes not returning history data --- commands/stories.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/commands/stories.py b/commands/stories.py index b35b522..208056c 100644 --- a/commands/stories.py +++ b/commands/stories.py @@ -97,7 +97,18 @@ def __print_burndown(token: str, iteration: Dict[str, Any], persons: Persons, accepted_points = history['data'][0][1] + last_counts: List[int] = [] for date, *counts in history['data'][1:]: + if len(counts) > 0: + # Update the last_counts variable if an update is available. + last_counts = counts + elif len(last_counts) > 0: + # If no counts are available, use those of the previous day. + counts = last_counts + else: + # If there are no last_counts either, just skip the day + continue + progress = '' if not hide_accepted: