Ensure success email subject is wired to EMAIL_SUBJECT_SUCCESS and never blank
Mirror and run GitLab CI / build (push) Has been cancelled
Ruff / ruff (push) Has been cancelled

This commit is contained in:
admin
2026-06-14 21:11:53 +00:00
parent 154cac6c7b
commit a3ca1f3505
+5 -9
View File
@@ -164,17 +164,13 @@ def send_success_email(
Subject is customizable via EMAIL_SUBJECT_SUCCESS. Subject is customizable via EMAIL_SUBJECT_SUCCESS.
Falls back to a safe default if the env var is missing or blank. Falls back to a safe default if the env var is missing or blank.
""" """
subject = _get_subject( # Read subject from environment; never allow blank
"EMAIL_SUBJECT_SUCCESS", subject = (os.getenv("EMAIL_SUBJECT_SUCCESS") or "").strip()
"ScrAIbe: Your transcript is ready", if not subject:
)
# Ensure subject is never blank
if not subject.strip():
subject = "ScrAIbe: Your transcript is ready" subject = "ScrAIbe: Your transcript is ready"
logger.warning("EMAIL_SUBJECT_SUCCESS was blank; using default subject.") logger.info("EMAIL_SUBJECT_SUCCESS not set or blank; using default subject.")
else: else:
logger.info("Using success email subject: %s", subject) logger.info("Using EMAIL_SUBJECT_SUCCESS: %s", subject)
body = ( body = (
"Hello,\n\n" "Hello,\n\n"