Skip to content

Django debug toolbar was throwing an exception getting the model app name, slightly more defensive approach to getting this value #384

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

Closed
wants to merge 2 commits into from

Conversation

adamhaney
Copy link

Traceback (most recent call last):
File "newrelic-1.10.0.28/newrelic/hooks/framework_django.py", line 475, in wrapper return wrapped(*args, **kwargs)
File "views/credit.py", line\ 64, in credit_button "count_class": 'ct-disabled' if got_credit else 'ct-active'
File "django/shortcuts/__init__.py", line 44, in render return HttpResponse(loader.render_to_string(*args, **kwargs),
File "django/template/loader.py", line 176, in render_to_string return t.render(context_instance)
File "django/template/base.py", line 140, in render return self._render(context)
File "django/test/utils.py", line 61, in instrumented_test_render template_rendered.send(sender=self,\ template=self, context=context)
File "django/dispatch/dispatcher.py", line 172, in send response = receiver(signal=self, sender=sender, **named)
File "debug_toolbar/panels/template.py", line 80, in _store_template_info model_name = "%s.%s" % (value.model._meta.app_label,\ value.model.__name__)
AttributeError: 'NoneType' object has no attribute '_meta'

This has been showing up in my logs for the past few days. I patched the part of the code that was trying to access _meta from a None variable, not sure why it was a None to begin with but this will print an empty string instead of throwing an exception.

@adamhaney adamhaney closed this May 21, 2013
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.

1 participant