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.
Falls back to a safe default if the env var is missing or blank.
"""
subject = _get_subject(
"EMAIL_SUBJECT_SUCCESS",
"ScrAIbe: Your transcript is ready",
)
# Ensure subject is never blank
if not subject.strip():
# Read subject from environment; never allow blank
subject = (os.getenv("EMAIL_SUBJECT_SUCCESS") or "").strip()
if not subject:
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:
logger.info("Using success email subject: %s", subject)
logger.info("Using EMAIL_SUBJECT_SUCCESS: %s", subject)
body = (
"Hello,\n\n"