X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/e10a6144b092d89e1410b240d7380d48a646ffc3..26c548c5fe8c7cc7227b5f38cd27e0278442dd76:/contrib/shipherd/models.py?ds=sidebyside diff --git a/contrib/shipherd/models.py b/contrib/shipherd/models.py index 2577245..0643c3e 100644 --- a/contrib/shipherd/models.py +++ b/contrib/shipherd/models.py @@ -71,11 +71,11 @@ class NavigationManager(TreeManager): return hosted_navigation def _add_to_cache(self, using, node, qs=None): - if node.pk is None: - return - if qs is None: - roots = node.hosted_navigation.select_related('target_node') + try: + roots = node.hosted_navigation.select_related('target_node') + except AttributeError: + roots = [] qs = self.none() for root in roots: