From 3d59a78c9fae4713e2784c6bbf6cd3a4489bc1ed Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Tue, 4 Oct 2022 20:48:09 +0200 Subject: [PATCH] little refactoring for send emails through gmail account --- cps/tasks/mail.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cps/tasks/mail.py b/cps/tasks/mail.py index 364356fe..139e6bff 100755 --- a/cps/tasks/mail.py +++ b/cps/tasks/mail.py @@ -164,7 +164,6 @@ class TaskEmail(CalibreTask): self.send_standard_email(msg) else: self.send_gmail_email(msg) - self._handleSuccess() except MemoryError as e: log.error_or_exception(e, stacklevel=3) self._handleError(u'MemoryError sending e-mail: {}'.format(str(e))) @@ -217,7 +216,8 @@ class TaskEmail(CalibreTask): log.debug("E-mail send successfully") def send_gmail_email(self, message): - return gmail.send_messsage(self.settings.get('mail_gmail_token', None), message) + gmail.send_messsage(self.settings.get('mail_gmail_token', None), message) + self._handleSuccess() @property def progress(self):