summaryrefslogtreecommitdiff
path: root/ishtar_common/models_common.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models_common.py')
-rw-r--r--ishtar_common/models_common.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py
index 9aec54534..403c020dc 100644
--- a/ishtar_common/models_common.py
+++ b/ishtar_common/models_common.py
@@ -751,10 +751,14 @@ class HierarchicalType(GeneralType):
class Meta:
abstract = True
+ has_full_label = True
+
def full_label(self):
lbls = [self.label]
item = self
- while item.parent:
+ parents = [self.pk] # prevent loop
+ while item.parent and item.parent_id not in parents:
+ parents.append(item.parent_id)
item = item.parent
lbls.append(item.label)
return " > ".join(reversed(lbls))