- node = None
- subpath = None
- if path is None:
- path = '/'
- try:
- current_site = Site.objects.get_current()
- if current_site:
- node, subpath = Node.objects.get_with_path(path, root=current_site.root_node, absolute_result=False)
- except Node.DoesNotExist:
+ if "philo.middleware.RequestNodeMiddleware" not in settings.MIDDLEWARE_CLASSES:
+ raise MIDDLEWARE_NOT_CONFIGURED
+
+ if not request.node: