Command response dynamic

* adds a check whether the mail could be sent properly or not and changes the resulting response
This commit is contained in:
mpeltriaux 2022-11-25 09:17:15 +01:00
parent 1f7f9c8964
commit 415089084e

View File

@ -131,4 +131,7 @@ class Command(BaseKonovaCommand):
] ]
) )
success = mail.send() success = mail.send()
if success == 1:
self._write_success(f"Mails with zip as attachment sent to {admin_mails}.") 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}'")