- node = None
- subpath = None
- if path is None:
- path = '/'
- current_site = Site.objects.get_current()
- try:
- node, subpath = Node.objects.get_with_path(path, root=current_site.root_node, absolute_result=False)
- except Node.DoesNotExist:
- raise Http404
+ if not hasattr(request, 'node'):
+ raise MIDDLEWARE_NOT_CONFIGURED