Use the new only_for_node_type_decorator()
This commit is contained in:
@@ -3,10 +3,13 @@ import logging
|
||||
from flask import current_app
|
||||
|
||||
from attract.node_types.task import node_type_task
|
||||
from pillar.api.nodes import only_for_node_type_decorator
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
only_for_task = only_for_node_type_decorator(node_type_task['name'])
|
||||
|
||||
|
||||
@only_for_task
|
||||
def fetch_task_extra_info(node):
|
||||
"""Extends the node with some info about its parent and project.
|
||||
|
||||
@@ -15,9 +18,6 @@ def fetch_task_extra_info(node):
|
||||
which we thus embed here.
|
||||
"""
|
||||
|
||||
if node.get('node_type') != node_type_task['name']:
|
||||
return
|
||||
|
||||
fetch_task_parent_info(node)
|
||||
fetch_task_project_info(node)
|
||||
|
||||
|
Reference in New Issue
Block a user