Skip to content

Caught AttributeError while rendering: 'Template' object has no attribute 'origin' #174

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 2 commits into from
Jun 10, 2011

Conversation

maraujop
Copy link
Contributor

@maraujop maraujop commented Jun 9, 2011

Fixes TemplateDebugPanel iterating over an unknown template without origin or name

Some applications render Templates that are dynamically generated using Template object, those don't have origin or name, so I guess the best is to skip them as they are usually used for small things. Somebody reported this here:
http://code.google.com/p/django-endless-pagination/issues/detail?id=7#c2

It breaks with current django-uni-form master too.

I was willing to add a test for this bug, but the middleware is broken in current master branch (test_middleware fails) and it turned out to be a nightmare. I think testing should be more isolated. Panels get loaded with the information of the project within you run tests. Maybe having test_settings and a small test_project would help.

Regards,
Miguel

@dcramer
Copy link
Contributor

dcramer commented Jun 9, 2011

I think a better solution here might be to simply check if the origin attribute exists on the Template object

@maraujop
Copy link
Contributor Author

Ok :) I also thought about doing that, here is the updated version.

dcramer added a commit that referenced this pull request Jun 10, 2011
Caught AttributeError while rendering: 'Template' object has no attribute 'origin'
@dcramer dcramer merged commit 0f4e780 into django-commons:master Jun 10, 2011
ryneeverett pushed a commit to ryneeverett/django-debug-toolbar that referenced this pull request Oct 2, 2016
Caught AttributeError while rendering: 'Template' object has no attribute 'origin'
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