Skip to content

AttributeError in RequestVarsPanel when using FallbackMiddleware #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 14, 2011

Conversation

dokterbob
Copy link
Contributor

Dear Rob,

Just now I ran into a bug in a situation where process_view was not called on the debug panels, as the response was actually returned by a middleware which caught an exception. The code I ran into this with is very similar to Django's own FallbackMiddleware in the static contrib module. The result was an AttributeError in request_vars.py as you're assuming some of view_func's attributes to be present.

So I made a simple patch checking for the existence of view_func in this particular panel and updating the context consequently.

Kinds regards,
Mathijs

PS. The error was spotted in a setup running Django 1.3 from SVN.

as a request attribute. This is especially true
for 'fallback' type of views that are rendered
from within middleware, such as the one used
in Django's own flatpages.
@samkuehn
Copy link

samkuehn commented Apr 7, 2011

I was having the same issue and this fixed it for me as well.

@markvl
Copy link

markvl commented Apr 8, 2011

This also fixes the problem I had with adding DjDT middleware before the flatpages middleware. (The same problem as reported here: http://groups.google.com/group/django-debug-toolbar/msg/78d0d0026be80757)

Thanks for the work dokterbob!

@wzzrd
Copy link

wzzrd commented Jul 14, 2011

Please pull this. It is a verified fix for a very annoying problem.

@dcramer dcramer merged commit f2aeaaa into django-commons:master Jul 14, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants