Correctly handle message when there is *not* a milestone to remove
This commit is contained in:
parent
453f7910ae
commit
d8cc600aa0
1 changed files with 4 additions and 3 deletions
|
@ -22,9 +22,10 @@ def move_issue(source_owner, source_repo, issue_number, destination_owner, desti
|
|||
if message:
|
||||
print(message)
|
||||
|
||||
if json_response and 'milestone' in json_response:
|
||||
print(f"We have removed the milestone {json_response['milestone']['title']} from this issue (milestones are specific to repositories).")
|
||||
del json_response['milestone']
|
||||
milestone = json_response.pop('milestone', {})
|
||||
if milestone:
|
||||
print(f"We have removed the milestone {milestone['title']} from this issue (milestones are specific to repositories).")
|
||||
# Note that pop has already thrown out the milestone from json_response
|
||||
|
||||
print(f"Creating issue {json_response['title']} now…")
|
||||
|
||||
|
|
Loading…
Reference in a new issue