Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
send_email: Only warn if EMAIL_HOST_PASSWORD is unset, not "".
Alex Vandiveree04f42897fc
diff --git a/zerver/lib/send_email.py b/zerver/lib/send_email.pyindex 8fae31424b8..c49f6fd744a 100644--- a/zerver/lib/send_email.py+++ b/zerver/lib/send_email.py@@ -597,7 +597,7 @@ def log_email_config_errors() -> None:The purpose of this function is to log (potential) config errors,but without raising an exception."""- if settings.EMAIL_HOST_USER and not settings.EMAIL_HOST_PASSWORD:+ if settings.EMAIL_HOST_USER and settings.EMAIL_HOST_PASSWORD is None:logger.error("An SMTP username was set (EMAIL_HOST_USER), but password is unset (EMAIL_HOST_PASSWORD).")diff --git a/zerver/tests/test_send_email.py b/zerver/tests/test_send_email.pyindex 986f9c81833..208875db6c8 100644--- a/zerver/tests/test_send_email.py+++ b/zerver/tests/test_send_email.py@@ -168,3 +168,13 @@ class TestSendEmail(ZulipTestCase):"An SMTP username was set (EMAIL_HOST_USER), but password is unset (EMAIL_HOST_PASSWORD)."],)++ # Empty string is OK+ with self.settings(EMAIL_HOST_USER="test", EMAIL_HOST_PASSWORD=""):+ send_email(+ "zerver/emails/password_reset",+ to_emails=[hamlet],+ from_name="From Name",+ from_address=FromAddress.NOREPLY,+ language="en",+ )