mirror of https://github.com/jumpserver/jumpserver
fix: Account backup: when sending to the mailbox fails, the task status also shows the success problem.
parent
46da05652a
commit
c593f91d77
|
@ -235,8 +235,8 @@ class AccountBackupHandler:
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
error = str(e)
|
error = str(e)
|
||||||
print(f'\033[31m>>> {error}\033[0m')
|
print(f'\033[31m>>> {error}\033[0m')
|
||||||
self.execution.status = Status.error
|
self.manager.status = Status.error
|
||||||
self.execution.summary['error'] = error
|
self.manager.summary['error'] = error
|
||||||
|
|
||||||
def backup_by_obj_storage(self):
|
def backup_by_obj_storage(self):
|
||||||
object_id = self.execution.snapshot.get('id')
|
object_id = self.execution.snapshot.get('id')
|
||||||
|
|
|
@ -97,10 +97,7 @@ def send_mail_attachment_async(subject, message, recipient_list, attachment_list
|
||||||
for attachment in attachment_list:
|
for attachment in attachment_list:
|
||||||
email.attach_file(attachment)
|
email.attach_file(attachment)
|
||||||
os.remove(attachment)
|
os.remove(attachment)
|
||||||
try:
|
return email.send()
|
||||||
return email.send()
|
|
||||||
except Exception as e:
|
|
||||||
logger.error("Sending mail attachment error: {}".format(e))
|
|
||||||
|
|
||||||
|
|
||||||
@shared_task(
|
@shared_task(
|
||||||
|
|
Loading…
Reference in New Issue