diff --git a/zerver/webhooks/github/tests.py b/zerver/webhooks/github/tests.py index 5aae92775b..b7a7aa879c 100644 --- a/zerver/webhooks/github/tests.py +++ b/zerver/webhooks/github/tests.py @@ -143,14 +143,14 @@ class GitHubWebhookTest(WebhookTestCase): self.check_webhook("issues", expected_topic, expected_message) def test_issue_assigned(self) -> None: - expected_message = "sbansal1999 assigned [issue #7](https://github.com/sbansal1999/testing-gh/issues/7) (assigned to sbansal1999):\n\n~~~ quote\nIDK how this works, lets see if it can be fixed or not.\n~~~" + expected_message = "sbansal1999 assigned [issue #7](https://github.com/sbansal1999/testing-gh/issues/7) (assigned to sbansal1999)." expected_topic = "testing-gh / issue #7 Sample Issue testing something" self.check_webhook("issues__assigned", expected_topic, expected_message) def test_issue_assigned_with_custom_topic_in_url(self) -> None: self.url = self.build_webhook_url(topic="notifications") expected_topic = "notifications" - expected_message = "sbansal1999 assigned [issue #7 Sample Issue testing something](https://github.com/sbansal1999/testing-gh/issues/7) (assigned to sbansal1999):\n\n~~~ quote\nIDK how this works, lets see if it can be fixed or not.\n~~~" + expected_message = "sbansal1999 assigned [issue #7 Sample Issue testing something](https://github.com/sbansal1999/testing-gh/issues/7) (assigned to sbansal1999)." self.check_webhook("issues__assigned", expected_topic, expected_message) def test_issue_unassigned(self) -> None: diff --git a/zerver/webhooks/github/view.py b/zerver/webhooks/github/view.py index 8b414adcac..fc909f0ca1 100644 --- a/zerver/webhooks/github/view.py +++ b/zerver/webhooks/github/view.py @@ -165,7 +165,7 @@ def get_issue_body(helper: Helper) -> str: action=action, url=issue["html_url"].tame(check_string), number=issue["number"].tame(check_int), - message=issue["body"].tame(check_none_or(check_string)), + message=None if action == "assigned" else 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, )