From 496b5f6b326af8c1caf50272230db1e85b54adb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 12 Oct 2016 13:44:06 +0200 Subject: [PATCH] Use the new only_for_node_type_decorator() --- attract/tasks/eve_hooks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/attract/tasks/eve_hooks.py b/attract/tasks/eve_hooks.py index 8198ffc..c87fd14 100644 --- a/attract/tasks/eve_hooks.py +++ b/attract/tasks/eve_hooks.py @@ -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)