Skip to content

Commit

Permalink
Merge pull request #43 from bigjools/flask-contrib-signals-fix
Browse files Browse the repository at this point in the history
Fix job_failed signal parameters
  • Loading branch information
bigjools authored May 2, 2024
2 parents f1f35a7 + fdc73ae commit 0fe03cc
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 0fe03cc

Please sign in to comment.