diff --git a/zerver/test_hooks.py b/zerver/test_hooks.py index cfa48ed9b9..3b7d9bd81e 100644 --- a/zerver/test_hooks.py +++ b/zerver/test_hooks.py @@ -811,7 +811,7 @@ class PagerDutyHookTests(AuthedTestCase): self.assertEqual(msg.subject, 'pagerduty') self.assertEqual( msg.content, - 'Unknown pagerdudy message\n``` py\n{u\'type\': u\'incident.triggered\'}\n```' + 'Unknown pagerduty message\n``` py\n{u\'type\': u\'incident.triggered\'}\n```' ) def test_unknown_message_type(self): @@ -820,5 +820,5 @@ class PagerDutyHookTests(AuthedTestCase): self.assertEqual(msg.subject, 'pagerduty') self.assertEqual( msg.content, - 'Unknown pagerdudy message\n``` py\n{u\'type\': u\'foo\'}\n```' + 'Unknown pagerduty message\n``` py\n{u\'type\': u\'foo\'}\n```' ) diff --git a/zerver/views/webhooks.py b/zerver/views/webhooks.py index 90aae3f916..0b3fdd5a5c 100644 --- a/zerver/views/webhooks.py +++ b/zerver/views/webhooks.py @@ -927,7 +927,7 @@ PAGER_DUTY_EVENT_NAMES = { 'incident.delegate': 'delineated', } -def build_pagerdudy_formatdict(message): +def build_pagerduty_formatdict(message): # Normalize the message dict, after this all keys will exist. I would # rather some strange looking messages than dropping pages. @@ -975,7 +975,7 @@ def build_pagerdudy_formatdict(message): def send_raw_pagerduty_json(user_profile, stream, message): subject = 'pagerduty' body = ( - u'Unknown pagerdudy message\n' + u'Unknown pagerduty message\n' u'``` py\n' u'%s\n' u'```') % (pprint.pformat(message),) @@ -1020,7 +1020,7 @@ def api_pagerduty_webhook(request, user_profile, stream=REQ(default='pagerduty') send_raw_pagerduty_json(user_profile, stream, message) try: - format_dict = build_pagerdudy_formatdict(message) + format_dict = build_pagerduty_formatdict(message) except: send_raw_pagerduty_json(user_profile, stream, message) else: