From 31bf37715cc1561f27946af79c3a0cdc276f7c67 Mon Sep 17 00:00:00 2001 From: eecavanna <134325062+eecavanna@users.noreply.github.com> Date: Thu, 21 Nov 2024 21:48:04 -0800 Subject: [PATCH] Ensure variable contains a string before using it as URL --- nmdc_server/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmdc_server/cli.py b/nmdc_server/cli.py index c45a095f..132c4dd8 100644 --- a/nmdc_server/cli.py +++ b/nmdc_server/cli.py @@ -146,7 +146,7 @@ def require_setting(name: str): # Post a message to Slack if a Slack webhook URL is defined. # Reference: https://api.slack.com/messaging/webhooks#posting_with_webhooks - if settings.slack_webhook_url_for_ingester not in [None, ""]: + if isinstance(settings.slack_webhook_url_for_ingester, str): click.echo("Posting message to Slack.") response = requests.post( settings.slack_webhook_url_for_ingester,