mirror of https://github.com/zulip/zulip.git
gitea: Support missing head/base refs.
This commit is contained in:
parent
f64d5e1db6
commit
74ac8c140c
|
@ -31,8 +31,10 @@ def format_pull_request_event(payload: WildValue, include_title: bool = False) -
|
||||||
target_branch = None
|
target_branch = None
|
||||||
base_branch = None
|
base_branch = None
|
||||||
if action != "edited":
|
if action != "edited":
|
||||||
target_branch = payload["pull_request"]["head"]["ref"].tame(check_string)
|
if "head" in payload["pull_request"]:
|
||||||
base_branch = payload["pull_request"]["base"]["ref"].tame(check_string)
|
target_branch = payload["pull_request"]["head"]["ref"].tame(check_string)
|
||||||
|
if "base" in payload["pull_request"]:
|
||||||
|
base_branch = payload["pull_request"]["base"]["ref"].tame(check_string)
|
||||||
title = payload["pull_request"]["title"].tame(check_string) if include_title else None
|
title = payload["pull_request"]["title"].tame(check_string) if include_title else None
|
||||||
stringified_assignee = assignee["login"].tame(check_string) if assignee else None
|
stringified_assignee = assignee["login"].tame(check_string) if assignee else None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue