Skip to content

Commit

Permalink
Fix job_failed signal parameters
Browse files Browse the repository at this point in the history
Fix a missing err parameter on the job_failed handler in the
flask_spinach object.
  • Loading branch information
bigjools committed May 2, 2024
1 parent f1f35a7 commit fdc73ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spinach/contrib/flask_spinach.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ def job_finished(*args, job=None, **kwargs):
pass

@signals.job_failed.connect_via(namespace)
def job_failed(args, job=None, **kwargs):
def job_failed(args, job=None, err=None, **kwargs):
if not flask.has_app_context():
ctx = app.app_context()
ctx.push()
flask.g.spinach_ctx = ctx
self.job_failed(job)
self.job_failed(job, err)

@classmethod
def job_started(cls, *args, job=None, **kwargs):
Expand All @@ -82,7 +82,7 @@ def job_finished(cls, *args, job=None, **kwargs):
pass

@classmethod
def job_failed(cls, *args, job=None, **kwargs):
def job_failed(cls, *args, job=None, err=None, **kwargs):
"""Callback for subclasses to receive job_failed signals.
There's no guarantee of ordering for Signal's callbacks,
Expand Down

0 comments on commit fdc73ae

Please sign in to comment.