mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
webhooks: Use partial with positional arguments.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
04638ffaee
commit
6fef5c3e46
@@ -251,7 +251,7 @@ def get_change_deployment_status_body(helper: Helper) -> str:
|
||||
)
|
||||
|
||||
|
||||
def get_create_or_delete_body(helper: Helper, action: str) -> str:
|
||||
def get_create_or_delete_body(action: str, helper: Helper) -> str:
|
||||
payload = helper.payload
|
||||
ref_type = payload["ref_type"].tame(check_string)
|
||||
return "{} {} {} {}.".format(
|
||||
@@ -814,9 +814,9 @@ def get_topic_based_on_type(payload: WildValue, event: str) -> str:
|
||||
EVENT_FUNCTION_MAPPER: Dict[str, Callable[[Helper], str]] = {
|
||||
"commit_comment": get_commit_comment_body,
|
||||
"closed_pull_request": get_closed_pull_request_body,
|
||||
"create": partial(get_create_or_delete_body, action="created"),
|
||||
"create": partial(get_create_or_delete_body, "created"),
|
||||
"check_run": get_check_run_body,
|
||||
"delete": partial(get_create_or_delete_body, action="deleted"),
|
||||
"delete": partial(get_create_or_delete_body, "deleted"),
|
||||
"deployment": get_deployment_body,
|
||||
"deployment_status": get_change_deployment_status_body,
|
||||
"discussion": get_discussion_body,
|
||||
|
||||
Reference in New Issue
Block a user