fix: SMTP SSL/TLS checkboxes not reflecting actual config in admin settings
Some checks failed
CI / ruff (push) Successful in 11s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / pytest (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled

The EmailStatusResponse didn't include smtp_use_tls/smtp_use_ssl fields,
and the JavaScript hardcoded defaults (TLS=true, SSL=false) instead of
reading from the API response. Now the API returns the effective values
and the UI displays them correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-19 16:11:24 +01:00
parent 573b0180ad
commit e23788cb7d
2 changed files with 6 additions and 2 deletions

View File

@@ -422,6 +422,8 @@ class EmailStatusResponse(BaseModel):
smtp_host: str | None = None
smtp_port: int | None = None
smtp_user: str | None = None
smtp_use_tls: bool | None = None
smtp_use_ssl: bool | None = None
mailgun_domain: str | None = None
aws_region: str | None = None
debug: bool
@@ -507,6 +509,8 @@ def get_email_status(
smtp_host=config["smtp_host"] if provider == "smtp" else None,
smtp_port=config["smtp_port"] if provider == "smtp" else None,
smtp_user=config["smtp_user"] if provider == "smtp" else None,
smtp_use_tls=config["smtp_use_tls"] if provider == "smtp" else None,
smtp_use_ssl=config["smtp_use_ssl"] if provider == "smtp" else None,
mailgun_domain=config["mailgun_domain"] if provider == "mailgun" else None,
aws_region=config["aws_region"] if provider == "ses" else None,
debug=config["debug"],

View File

@@ -356,8 +356,8 @@ function adminSettings() {
smtp_port: this.emailSettings.smtp_port || 587,
smtp_user: this.emailSettings.smtp_user || '',
smtp_password: '', // Never populated from API
smtp_use_tls: true,
smtp_use_ssl: false,
smtp_use_tls: this.emailSettings.smtp_use_tls ?? true,
smtp_use_ssl: this.emailSettings.smtp_use_ssl ?? false,
sendgrid_api_key: '',
mailgun_api_key: '',
mailgun_domain: this.emailSettings.mailgun_domain || '',