mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
integrations: Reformat Github issue assigned message body.
Instead of adding the assignee to the end of the message body, we update the message body where the verb is so that the link formatting at the end of the message is not broken, for example: "user_a assigned user_b to [issue #XXX title text is here](link)." Also updates the issue title in the test fixture so that it tests that only the first instance of "assigned" or "unassigned" in the issue title is updated for the assignee text. Also adds punctuation to the issue title in the test fixture to test the expected behavior for titles that end in a value from `string.punctuation`.
This commit is contained in:
committed by
Tim Abbott
parent
d82efbd503
commit
f6e17fa972
@@ -170,9 +170,9 @@ def get_issue_body(helper: Helper) -> str:
|
||||
if has_assignee:
|
||||
stringified_assignee = payload["assignee"]["login"].tame(check_string)
|
||||
if action == "assigned":
|
||||
return f"{base_message[:-1]} to {stringified_assignee}."
|
||||
return base_message.replace("assigned", f"assigned {stringified_assignee} to", 1)
|
||||
elif action == "unassigned":
|
||||
return base_message.replace("unassigned", f"unassigned {stringified_assignee} from")
|
||||
return base_message.replace("unassigned", f"unassigned {stringified_assignee} from", 1)
|
||||
|
||||
return base_message
|
||||
|
||||
|
||||
Reference in New Issue
Block a user