Skip to content

Commit

Permalink
Bug fix: sending email on task group error didn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
jdetaeye committed Jan 30, 2024
1 parent 4849755 commit 4a960f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion freppledb/execute/management/commands/scheduletasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ def handle(self, *args, **options):
task.message = "Failed at tasks: %s" % ", ".join(failed)
else:
task.message = task.check_message
raise Exception(task.message)
else:
task.status = "Done"
task.message = ""
Expand Down Expand Up @@ -314,7 +315,7 @@ def handle(self, *args, **options):
to=correctedRecipients,
).send()
except Exception as e:
task.message = "Can't send failure e-mail: %s" % e
task.message = "Can't send success e-mail: %s" % e
task.save(
using=database,
update_fields=[
Expand Down

0 comments on commit 4a960f6

Please sign in to comment.