def points_history(self): if not hasattr(self, '_points_history'): phistory = [] cpoints = 0 closed = False for h in self.history: # TODO remove 'change_time' when all bugs are updated hdate = dateutil.parser.parse(h.get('when') or h.get('change_time')).date() for change in h['changes']: fn = change['field_name'] # TODO remove 'status' when all bugs are updated if fn == 'bug_status' or fn == 'status': now_closed = is_closed(change['added']) if closed != now_closed: pts = 0 if now_closed else cpoints phistory.append({ 'date': hdate, 'points': pts, }) closed = now_closed elif fn == 'status_whiteboard': pts = get_story_data(change['added'])['points'] if pts != cpoints: cpoints = pts if not closed: phistory.append({'date': hdate, 'points': pts}) self._points_history = phistory return self._points_history
def points_history(self): if not hasattr(self, '_points_history'): phistory = [] cpoints = 0 closed = False for h in self.history: # TODO remove 'change_time' when all bugs are updated hdate = dateutil.parser.parse( h.get('when') or h.get('change_time')).date() for change in h['changes']: fn = change['field_name'] # TODO remove 'status' when all bugs are updated if fn == 'bug_status' or fn == 'status': now_closed = is_closed(change['added']) if closed != now_closed: pts = 0 if now_closed else cpoints phistory.append({ 'date': hdate, 'points': pts, }) closed = now_closed elif fn == 'status_whiteboard': pts = get_story_data(change['added'])['points'] if pts != cpoints: cpoints = pts if not closed: phistory.append({'date': hdate, 'points': pts}) self._points_history = phistory return self._points_history
def is_closed(self): return is_closed(self.status)