Minor improvements to navigationoverrides, including admin support and working naviga...
[philo.git] / models / base.py
index 0598407..202c2f3 100644 (file)
@@ -402,6 +402,9 @@ class TreeModel(MPTTModel):
        slug = models.SlugField(max_length=255)
        
        def get_path(self, root=None, pathsep='/', field='slug'):
        slug = models.SlugField(max_length=255)
        
        def get_path(self, root=None, pathsep='/', field='slug'):
+               if root == self:
+                       return ''
+               
                if root is not None and not self.is_descendant_of(root):
                        raise AncestorDoesNotExist(root)
                
                if root is not None and not self.is_descendant_of(root):
                        raise AncestorDoesNotExist(root)