Verified Commit 15326d98 authored by uncol's avatar uncol
Browse files

Merge branch 'noc-patch-wf' of code.getnoc.com:noc/noc into noc-patch-wf

parents 443c3982 05ded214
Pipeline #2835 passed with stage
in 34 seconds
......@@ -15,7 +15,7 @@ from noc.models import get_object
logger = logging.getLogger(__name__)
def transition_job(handler, model, object):
def state_job(handler, model, object):
"""
State.job_handler wrapper
:param handler:
......
......@@ -29,7 +29,7 @@ from noc.models import get_model_id
logger = logging.getLogger(__name__)
id_lock = Lock()
TRANSITION_HANDLER = "noc.core.wf.transition.transition_job"
STATE_JOB = "noc.core.wf.transition.state_job"
@bi_sync
......@@ -133,7 +133,7 @@ class State(Document):
h = get_handler(self.job_handler)
if h:
call_later(
TRANSITION_HANDLER,
STATE_JOB,
handler=self.job_handler,
model=get_model_id(obj),
object=str(obj.pk)
......
......@@ -94,7 +94,7 @@ class Transition(Document):
if self.handlers:
logger.debug("[%s|%s|%s] Running transition handlers",
obj, obj.state.name, self.label)
for hn in obj.state.on_leave_handlers:
for hn in self.handlers:
h = get_handler(hn)
if h:
logger.debug("[%s|%s|%s] Running %s",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment