From 5ad172f7045d75c48faf7452fc096afc11cf9063 Mon Sep 17 00:00:00 2001 From: Michael Derynck Date: Thu, 1 Sep 2022 07:29:57 -0600 Subject: [PATCH] Remove unused footer/duplicate block_id from post message to channel --- .../slack/scenarios/notification_delivery.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/engine/apps/slack/scenarios/notification_delivery.py b/engine/apps/slack/scenarios/notification_delivery.py index 056e3ddd..4b9805da 100644 --- a/engine/apps/slack/scenarios/notification_delivery.py +++ b/engine/apps/slack/scenarios/notification_delivery.py @@ -24,7 +24,6 @@ class NotificationDeliveryStep(scenario_step.ScenarioStep): self.post_message_to_channel( f"Attempt to send an SMS to {user_verbal_with_mention} has been failed due to a plan limit", alert_group.slack_message.channel_id, - color="red", ) elif ( log_record.notification_error_code @@ -33,7 +32,6 @@ class NotificationDeliveryStep(scenario_step.ScenarioStep): self.post_message_to_channel( f"Attempt to call to {user_verbal_with_mention} has been failed due to a plan limit", alert_group.slack_message.channel_id, - color="red", ) elif ( log_record.notification_error_code @@ -42,7 +40,6 @@ class NotificationDeliveryStep(scenario_step.ScenarioStep): self.post_message_to_channel( f"Failed to send email to {user_verbal_with_mention}. Exceeded limit for mails", alert_group.slack_message.channel_id, - color="red", ) elif ( log_record.notification_error_code @@ -52,18 +49,14 @@ class NotificationDeliveryStep(scenario_step.ScenarioStep): self.post_message_to_channel( f"Failed to send an SMS to {user_verbal_with_mention}. Phone number is not verified", alert_group.slack_message.channel_id, - color="red", ) elif log_record.notification_channel == UserNotificationPolicy.NotificationChannel.PHONE_CALL: self.post_message_to_channel( f"Failed to call to {user_verbal_with_mention}. Phone number is not verified", alert_group.slack_message.channel_id, - color="red", ) - def post_message_to_channel(self, text, channel, color=None, footer=None): - # TODO: No color in blocks, use prefix emoji? - # color_id = self.get_color_id(color) + def post_message_to_channel(self, text, channel): blocks = [ { "type": "section", @@ -73,15 +66,6 @@ class NotificationDeliveryStep(scenario_step.ScenarioStep): "text": text, }, }, - {"type": "divider"}, - { - "type": "section", - "block_id": "alert", - "text": { - "type": "mrkdwn", - "text": footer, - }, - }, ] try: # TODO: slack-onprem, check exceptions