From 11d5f2cafbbd0c1809e74bad93ba1c2dfe4e8c34 Mon Sep 17 00:00:00 2001 From: Quinten Steenhuis Date: Sat, 21 Feb 2026 22:32:53 -0500 Subject: [PATCH 1/2] Fix #1000 - bug with logging multiple emails --- .../AssemblyLine/data/questions/al_document.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/docassemble/AssemblyLine/data/questions/al_document.yml b/docassemble/AssemblyLine/data/questions/al_document.yml index a56c824b..2a2c4e5e 100644 --- a/docassemble/AssemblyLine/data/questions/al_document.yml +++ b/docassemble/AssemblyLine/data/questions/al_document.yml @@ -34,9 +34,14 @@ code: | key=action_argument('key'), preferred_formats=preferred_formats, ) + email_arg = action_argument('email') + if isinstance(email_arg, list): + email_str = ', '.join(email_arg) + else: + email_str = str(email_arg) if email_success: # Exact phrase below is in Docassemble's words dictionary - log(word('E-mail was sent to') + ' ' + action_argument('email') ,'success') + log(word('E-mail was sent to') + ' ' + email_str, 'success') else: # E-mail failed is not in the default Docassemble words dictionary log(word('E-mail failed'), 'error') @@ -67,10 +72,15 @@ code: | key=action_argument('key'), preferred_formats=preferred_formats, ) + email_arg = action_argument('email') + if isinstance(email_arg, list): + email_str = ', '.join(email_arg) + else: + email_str = str(email_arg) if email_success: - log("Email sent to " + action_argument('email')) # to log file + log("Email sent to " + email_str) # to log file else: - log(word('E-mail failed to ') + action_argument('email')) + log(word('E-mail failed to ') + email_str) json_response({'success': email_success}) From 9a4f65e113c0f442c6a95bfafd817d91709c2c29 Mon Sep 17 00:00:00 2001 From: Quinten Steenhuis Date: Mon, 23 Feb 2026 10:45:23 -0500 Subject: [PATCH 2/2] PR feedback - use fstrings instead of intermediate var --- .../AssemblyLine/data/questions/al_document.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docassemble/AssemblyLine/data/questions/al_document.yml b/docassemble/AssemblyLine/data/questions/al_document.yml index b7c31419..23638d50 100644 --- a/docassemble/AssemblyLine/data/questions/al_document.yml +++ b/docassemble/AssemblyLine/data/questions/al_document.yml @@ -41,10 +41,10 @@ code: | email_str = str(email_arg) if email_success: # Exact phrase below is in Docassemble's words dictionary - log(word("E-mail was sent to") + " " + action_argument("email"), "success") + log(f" {word('E-mail was sent to')} {email_str}", "success") else: # E-mail failed is not in the default Docassemble words dictionary - log(word("E-mail failed"), "error") + log(f" {word('E-mail failed')} to {email_str}", "error") --- generic object: ALDocumentBundle event: x.send_email_to_action_event @@ -78,9 +78,9 @@ code: | else: email_str = str(email_arg) if email_success: - log("Email sent to " + action_argument("email")) # to log file + log(f"Email sent to {email_str}") # to log file else: - log(word("E-mail failed to ") + action_argument("email")) + log(f" {word('E-mail failed to ')} {email_str}") json_response({"success": email_success}) --- @@ -218,4 +218,4 @@ subquestion: | Generating preview... event: al_preview_waiting_screen -reload: True \ No newline at end of file +reload: True