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:
|
if message:
|
||||||
print(message)
|
print(message)
|
||||||
|
|
||||||
if json_response and 'milestone' in json_response:
|
milestone = json_response.pop('milestone', {})
|
||||||
print(f"We have removed the milestone {json_response['milestone']['title']} from this issue (milestones are specific to repositories).")
|
if milestone:
|
||||||
del json_response['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…")
|
print(f"Creating issue {json_response['title']} now…")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue