def clean(self):
        """ Prevents cycles in the tree. """
        super(CTENode, self).clean()
        if self.parent and self.pk in getattr(self.parent, self._cte_node_path):
            raise ValidationError(_("A node cannot be made a descendant of itself."))
def clean ( self ) : super ( CTENode , self ) . clean ( ) if self . parent and self . pk in getattr ( self . parent , self . _cte_node_path ) : raise ValidationError ( _ ( "A node cannot be made a descendant of itself." ) )
Prevents cycles in the tree.