Skip to content
Snippets Groups Projects
Commit 19c46bea authored by ayeaye's avatar ayeaye
Browse files

Don't die on undated issues

parent 11739c14
No related merge requests found
......@@ -16,18 +16,22 @@ def makeIssue(issue, isMilestone = False):
end = date.fromisoformat(issue.due_date)
except (TypeError, KeyError, AttributeError):
if isMilestone:
logging.warning(f"Punting milestone: {issue.title}")
return None
try:
end = date.fromisoformat(issue.milestone["due_date"])
except (TypeError, KeyError, AttributeError):
logging.warning(f"Punting issue: {issue.title}, {issue.milestone}")
return None
logging.warning(f"Milestone without due_date: {issue.title}")
end = None
else:
try:
end = date.fromisoformat(issue.milestone["due_date"])
except (TypeError, KeyError, AttributeError):
logging.warning(f"Issue without due_date: {issue.title}, {issue.milestone}")
end = None
try:
start = date.fromisoformat(issue.start_date)
except AttributeError:
start = end - timedelta(issue.time_stats()["time_estimate"] * 3 / 86400)
except (TypeError, AttributeError):
if end:
start = end - timedelta(issue.time_stats()["time_estimate"] * 3 / 86400)
else:
start = None
comp = 0
try:
......@@ -57,7 +61,7 @@ def makeIssue(issue, isMilestone = False):
pClass = cls,
pName = issue.title,
pStart = str(start),
pEnd = end.isoformat(),
pEnd = str(end),
pLink = issue.web_url,
pGroup = int(isMilestone),
pParent = 0 if isMilestone or issue.milestone is None else issue.milestone['iid'] + MILESTONE_OFFSET,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment