From b8d9343682e436afd4f0a3907464981cc722e2c2 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Fri, 25 Nov 2022 09:17:15 +0100 Subject: [PATCH] Command response dynamic * adds a check whether the mail could be sent properly or not and changes the resulting response --- konova/management/commands/generate_report.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/konova/management/commands/generate_report.py b/konova/management/commands/generate_report.py index be0531ff..51091871 100644 --- a/konova/management/commands/generate_report.py +++ b/konova/management/commands/generate_report.py @@ -131,4 +131,7 @@ class Command(BaseKonovaCommand): ] ) success = mail.send() - self._write_success(f"Mails with zip as attachment sent to {admin_mails}.") + if success == 1: + self._write_success(f"Mails with zip as attachment sent to {admin_mails}.") + else: + self._write_error(f"Something went wrong during mail sending. Returned sending code was '{success}'")