From 5e45d1970fa6462c4718cad8f68c35a999d31312 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 19 May 2014 20:04:32 -0400 Subject: [PATCH] Check if a node is a root node the proper way --- apps/document_indexing/links.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/document_indexing/links.py b/apps/document_indexing/links.py index 23d8c77936..64636ac240 100644 --- a/apps/document_indexing/links.py +++ b/apps/document_indexing/links.py @@ -14,13 +14,11 @@ from .permissions import (PERMISSION_DOCUMENT_INDEXING_VIEW, def is_not_root_node(context): - # TODO: FIX: Check for parent node the proper way - return context['node'].parent is not None + return not context['node'].is_root_node() def is_not_instance_root_node(context): - # TODO: FIX: Check for parent node the proper way - return context['object'].parent is not None + return not context['object'].is_root_node() index_setup = {'text': _(u'indexes'), 'view': 'index_setup_list', 'icon': 'tab.png', 'permissions': [PERMISSION_DOCUMENT_INDEXING_SETUP], 'children_view_regex': [r'^index_setup', r'^template_node']}