Use the 'handler' prefix

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2019-04-27 01:37:14 -04:00
parent fba0c40bef
commit f9866e846a
6 changed files with 24 additions and 19 deletions

View File

@@ -15,6 +15,15 @@ def handler_index_document(sender, **kwargs):
)
def handler_launch_workflow(sender, instance, created, **kwargs):
Workflow = apps.get_model(
app_label='document_states', model_name='Workflow'
)
if created:
Workflow.objects.launch_for(instance)
def handler_trigger_transition(sender, **kwargs):
action = kwargs['instance']
@@ -45,12 +54,3 @@ def handler_trigger_transition(sender, **kwargs):
comment=_('Event trigger: %s') % EventType.get(name=action.verb).label,
transition=valid_transitions[0]
)
def launch_workflow(sender, instance, created, **kwargs):
Workflow = apps.get_model(
app_label='document_states', model_name='Workflow'
)
if created:
Workflow.objects.launch_for(instance)