Skip to content

Conversation

@robgolding
Copy link
Contributor

A small change to the content method in the RequestVarsDebugPanel, so that if the view_func doesn't have a __name__ attribute, the __class__.__name__ will be tried instead.

Otherwise, <unknown> is used to save an AttributeError being raised if neither exist.

This issue became apparent when using a form wizard, though I think Django 1.3's class-based views should be safe due to the way they are instantiated (ViewClass.as_view()).

…used

If view_func doesn't have a __name__ attribute, then __class__.__name__ is
tried instead. If that doesn't exist either, then '<unknown>' is used.
dcramer added a commit that referenced this pull request May 10, 2011
Fix for missing __name__ attribute when using class based views (i.e. FormWizard)
@dcramer dcramer merged commit a72e22c into django-commons:master May 10, 2011
ryneeverett pushed a commit to ryneeverett/django-debug-toolbar that referenced this pull request Oct 2, 2016
Fix for missing __name__ attribute when using class based views (i.e. FormWizard)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants