try:
return Navigation.objects.filter(node__in=node.get_ancestors(include_self=True), key=key).order_by('-node__level')[0].node
except:
- if settings.TEMPLATE_DEBUG:
- raise
return node
\ No newline at end of file
except Node.DoesNotExist:
node = None
else:
- if subpath and not node.handles_subpath(subpath):
- node = None
-
- if node:
if subpath is None:
subpath = ""
subpath = "/" + subpath
- if trailing_slash and subpath[-1] != "/":
- subpath += "/"
-
- node.subpath = subpath
+ if not node.handles_subpath(subpath):
+ node = None
+ else:
+ if trailing_slash and subpath[-1] != "/":
+ subpath += "/"
+
+ node.subpath = subpath
request._found_node = node