Check if a node is a root node the proper way, make 'root' translatable
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.utils.html import mark_safe
|
||||
from django.utils.translation import ugettext
|
||||
|
||||
from .models import IndexInstanceNode
|
||||
|
||||
@@ -82,8 +83,8 @@ def node_level(x):
|
||||
u''.join(
|
||||
[
|
||||
u' ' * (getattr(x, x._mptt_meta.level_attr) - 1),
|
||||
u'' if x.parent else u'',
|
||||
unicode(x if x.parent else 'root')
|
||||
u'' if x.is_root_node() else u'',
|
||||
ugettext('root') if x.is_root_node() else unicode(x)
|
||||
]
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user