From 912a95819b6d8f8bb3a510c14a9f7b3cb060108a Mon Sep 17 00:00:00 2001 From: Stephen Burrows Date: Tue, 16 Nov 2010 11:49:09 -0500 Subject: [PATCH] Switched node_view conditions for raising MIDDLEWARE_NOT_CONFIGURED to actually check whether the middleware is configured. This allows errors in request.node evaluation to propogate and be more easily debugged. --- views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/views.py b/views.py index 41718e5..255e54e 100644 --- a/views.py +++ b/views.py @@ -1,3 +1,4 @@ +from django.conf import settings from django.http import Http404 from django.views.decorators.vary import vary_on_headers from philo.exceptions import MIDDLEWARE_NOT_CONFIGURED @@ -5,7 +6,7 @@ from philo.exceptions import MIDDLEWARE_NOT_CONFIGURED @vary_on_headers('Accept') def node_view(request, path=None, **kwargs): - if not hasattr(request, 'node'): + if "philo.middleware.RequestNodeMiddleware" not in settings.MIDDLEWARE_CLASSES: raise MIDDLEWARE_NOT_CONFIGURED if not request.node: -- 2.20.1