Use the new only_for_node_type_decorator()

This commit is contained in:
2016-10-12 13:44:06 +02:00
parent 13eeb7d6c3
commit 496b5f6b32

View File

@@ -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)