From 6d477231df234cd7f708e59bc9ab6cbd73be8962 Mon Sep 17 00:00:00 2001 From: Alexander Kaschta <alexander.kaschta9@kit.edu> Date: Mon, 17 Mar 2025 17:27:19 +0100 Subject: [PATCH] UPD: E-Mail override settings for devel --- api/bcd_request.py | 8 ++++---- model/settings.py | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/api/bcd_request.py b/api/bcd_request.py index d4b157d..59cb18d 100644 --- a/api/bcd_request.py +++ b/api/bcd_request.py @@ -256,8 +256,8 @@ def send_bcd_request(bcd_request: BCDRequestModel, mgr: Mgr, receiver=settings.b subject = f'[{host_mode}] {subject}' # hacky way to intercept mails for development. In production, the assignment should be used - if settings.bcd_request_email_receivers is not None: - receiver = settings.bcd_request_email_receivers + if settings.bcd_request_override_mail_receiver is not None: + receiver = settings.bcd_request_override_mail_receiver send_email(to=receiver, sender=settings.patch_request_email_sender, @@ -289,8 +289,8 @@ def send_bcd_request_confirmation(bcd_request: BCDRequestModel, mgr: Mgr, receiv subject = f'[{host_mode}] {subject}' # hacky way to intercept mails for development. In production, the assignment should be used - if settings.patch_request_email_receivers is not None: - receiver = settings.patch_request_email_receivers + if settings.bcd_request_override_mail_receiver is not None: + receiver = settings.bcd_request_override_mail_receiver send_email(to=receiver, sender=settings.bcd_request_email_sender, diff --git a/model/settings.py b/model/settings.py index 93bc110..27fab1d 100644 --- a/model/settings.py +++ b/model/settings.py @@ -49,7 +49,8 @@ class Settings(BaseSettings): patch_request_email_sender: str = '' patch_request_assignment: dict[str, str] = {} - bcd_request_email_receivers: Optional[str] = None + bcd_request_email_receivers: str = None + bcd_request_override_mail_receiver: Optional[str] = None bcd_request_email_sender: str = '' mail_smarthost: str = 'smarthost.kit.edu' -- GitLab