From d8e6b15b63eeb751049821dc1a839069d151fc3a Mon Sep 17 00:00:00 2001 From: fynnbe Date: Wed, 13 Nov 2024 23:02:23 +0100 Subject: [PATCH] fix notify_uploader --- .../mailroom/send_email.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bioimageio_collection_backoffice/mailroom/send_email.py b/bioimageio_collection_backoffice/mailroom/send_email.py index 46b8a58e..622db390 100644 --- a/bioimageio_collection_backoffice/mailroom/send_email.py +++ b/bioimageio_collection_backoffice/mailroom/send_email.py @@ -17,19 +17,17 @@ def notify_uploader(rv: Union[RecordDraft, Record], subject_end: str, msg: str): - email, name = rv.get_uploader() - if email is None: - raise ValueError("missing uploader email") + uploader = rv.get_uploader() subject = f"{STATUS_UPDATE_SUBJECT}{rv.id} {rv.version} {subject_end.strip()}" - if email == BOT_EMAIL: + if uploader.email == BOT_EMAIL: logger.info("skipping email '{}' to {}", subject, BOT_EMAIL) return send_email( subject=subject, body=( - f"Dear {name},\n" + f"Dear {uploader.name},\n" + f"{msg.strip()}\n" + "Kind regards,\n" + "The bioimage.io bot 🦒\n" @@ -37,7 +35,7 @@ def notify_uploader(rv: Union[RecordDraft, Record], subject_end: str, msg: str): ).replace( "\n", "\n\n" # respect newlines in markdown ), - recipients=[email], + recipients=[uploader.email], )