mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 11:22:04 +00:00
integration: Refactor get_issue_event_message to use kwarg.
Previously, some call sites for the function provided optional arguments as positional arguments. These changes will allow the arguments to be passed as keyword arguments to the function and fix up the call sites of the function to pass keyword arguments instead.
This commit is contained in:
@@ -161,11 +161,11 @@ def get_issue_body(helper: Helper) -> str:
|
||||
issue = payload["issue"]
|
||||
assignee = issue["assignee"]
|
||||
return get_issue_event_message(
|
||||
get_sender_name(payload),
|
||||
action,
|
||||
issue["html_url"].tame(check_string),
|
||||
issue["number"].tame(check_int),
|
||||
issue["body"].tame(check_none_or(check_string)),
|
||||
user_name=get_sender_name(payload),
|
||||
action=action,
|
||||
url=issue["html_url"].tame(check_string),
|
||||
number=issue["number"].tame(check_int),
|
||||
message=issue["body"].tame(check_none_or(check_string)),
|
||||
assignee=assignee["login"].tame(check_string) if assignee else None,
|
||||
title=issue["title"].tame(check_string) if include_title else None,
|
||||
)
|
||||
@@ -185,11 +185,11 @@ def get_issue_comment_body(helper: Helper) -> str:
|
||||
action += "({}) on".format(comment["html_url"].tame(check_string))
|
||||
|
||||
return get_issue_event_message(
|
||||
get_sender_name(payload),
|
||||
action,
|
||||
issue["html_url"].tame(check_string),
|
||||
issue["number"].tame(check_int),
|
||||
comment["body"].tame(check_string),
|
||||
user_name=get_sender_name(payload),
|
||||
action=action,
|
||||
url=issue["html_url"].tame(check_string),
|
||||
number=issue["number"].tame(check_int),
|
||||
message=comment["body"].tame(check_string),
|
||||
title=issue["title"].tame(check_string) if include_title else None,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user