diff --git a/prom2teams/app/teams_client.py b/prom2teams/app/teams_client.py index ffa7219..cd8e0a8 100644 --- a/prom2teams/app/teams_client.py +++ b/prom2teams/app/teams_client.py @@ -44,7 +44,7 @@ def simple_post(teams_webhook_url, message): def _do_post(self, teams_webhook_url, message): response = self.session.post(teams_webhook_url, data=message, timeout=self.timeout) - if not response.status_code == 202 and not (response.status_code == 200 and response.text == '1'): + if response.status_code != 202 and (response.status_code != 200 or response.text != '1'): exception_msg = 'Error performing request to: {}.\n' \ ' Returned status code: {}.\n' \ ' Returned data: {}\n' \