Opened 13 years ago

Closed 13 years ago

#17349 closed Bug (worksforme)

KeyError in Auth admin

Reported by: jamesdabbs@… Owned by: nobody
Component: contrib.admin Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When navigating to /admin/auth/user/, I get the error included below. It looks like there's a problem rendering the X and check icons for boolean True and False where the BOOLEAN_MAPPING dict is expecting True and gets 'true' instead.

Django Version: 1.3.1
Python Version: 2.7.2

Template error:
In template /app/lib/python2.7/site-packages/django/contrib/admin/templates/admin/change_list.html, error at line 97
   Caught KeyError while rendering: u'true'
   87 :         {% endif %}


   88 :       {% endblock %}


   89 : 


   90 :       <form id="changelist-form" action="" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}>{% csrf_token %}


   91 :       {% if cl.formset %}


   92 :         <div>{{ cl.formset.management_form }}</div>


   93 :       {% endif %}


   94 : 


   95 :       {% block result_list %}


   96 :           {% if action_form and actions_on_top and cl.full_result_count %}{% admin_actions %}{% endif %}


   97 :            {% result_list cl %} 


   98 :           {% if action_form and actions_on_bottom and cl.full_result_count %}{% admin_actions %}{% endif %}


   99 :       {% endblock %}


   100 :       {% block pagination %}{% pagination cl %}{% endblock %}


   101 :       </form>


   102 :     </div>


   103 :   </div>


   104 : {% endblock %}


   105 : 

Traceback:
File "/app/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/app/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
  307.                 return self.admin_site.admin_view(view)(*args, **kwargs)
File "/app/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  93.                     response = view_func(request, *args, **kwargs)
File "/app/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  79.         response = view_func(request, *args, **kwargs)
File "/app/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  197.             return view(request, *args, **kwargs)
File "/app/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
  28.             return bound_func(*args, **kwargs)
File "/app/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  93.                     response = view_func(request, *args, **kwargs)
File "/app/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
  24.                 return func(self, *args2, **kwargs2)
File "/app/lib/python2.7/site-packages/django/contrib/admin/options.py" in changelist_view
  1179.         ], context, context_instance=context_instance)
File "/app/lib/python2.7/site-packages/django/shortcuts/__init__.py" in render_to_response
  20.     return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/app/lib/python2.7/site-packages/django/template/loader.py" in render_to_string
  188.         return t.render(context_instance)
File "/app/lib/python2.7/site-packages/django/template/base.py" in render
  123.             return self._render(context)
File "/app/lib/python2.7/site-packages/django/template/base.py" in _render
  117.         return self.nodelist.render(context)
File "/app/lib/python2.7/site-packages/django/template/base.py" in render
  744.                 bits.append(self.render_node(node, context))
File "/app/lib/python2.7/site-packages/django/template/debug.py" in render_node
  73.             result = node.render(context)
File "/app/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  127.         return compiled_parent._render(context)
File "/app/lib/python2.7/site-packages/django/template/base.py" in _render
  117.         return self.nodelist.render(context)
File "/app/lib/python2.7/site-packages/django/template/base.py" in render
  744.                 bits.append(self.render_node(node, context))
File "/app/lib/python2.7/site-packages/django/template/debug.py" in render_node
  73.             result = node.render(context)
File "/app/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  127.         return compiled_parent._render(context)
File "/app/lib/python2.7/site-packages/django/template/base.py" in _render
  117.         return self.nodelist.render(context)
File "/app/lib/python2.7/site-packages/django/template/base.py" in render
  744.                 bits.append(self.render_node(node, context))
File "/app/lib/python2.7/site-packages/django/template/debug.py" in render_node
  73.             result = node.render(context)
File "/app/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  64.             result = block.nodelist.render(context)
File "/app/lib/python2.7/site-packages/django/template/base.py" in render
  744.                 bits.append(self.render_node(node, context))
File "/app/lib/python2.7/site-packages/django/template/debug.py" in render_node
  73.             result = node.render(context)
File "/app/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  64.             result = block.nodelist.render(context)
File "/app/lib/python2.7/site-packages/django/template/base.py" in render
  744.                 bits.append(self.render_node(node, context))
File "/app/lib/python2.7/site-packages/django/template/debug.py" in render_node
  73.             result = node.render(context)
File "/app/lib/python2.7/site-packages/django/template/base.py" in render
  921.                     dict = func(*args)
File "/app/lib/python2.7/site-packages/django/contrib/admin/templatetags/admin_list.py" in result_list
  232.             'results': list(results(cl))}
File "/app/lib/python2.7/site-packages/django/contrib/admin/templatetags/admin_list.py" in results
  217.             yield ResultList(None, items_for_result(cl, res, None))
File "/app/lib/python2.7/site-packages/django/contrib/admin/templatetags/admin_list.py" in __init__
  209.         super(ResultList, self).__init__(*items)
File "/app/lib/python2.7/site-packages/django/contrib/admin/templatetags/admin_list.py" in items_for_result
  165.                     result_repr = display_for_field(value, f)
File "/app/lib/python2.7/site-packages/django/contrib/admin/util.py" in display_for_field
  285.         return _boolean_icon(value)
File "/app/lib/python2.7/site-packages/django/contrib/admin/templatetags/admin_list.py" in _boolean_icon
  126.     return mark_safe(u'<img src="%simg/admin/icon-%s.gif" alt="%s" />' % (settings.ADMIN_MEDIA_PREFIX, BOOLEAN_MAPPING[field_val], field_val))

Exception Type: TemplateSyntaxError at /admin/auth/user/
Exception Value: Caught KeyError while rendering: u'true'

Change History (1)

comment:1 by Preston Holmes, 13 years ago

Resolution: worksforme
Status: newclosed

This is more likely something related to something wonky with your settings.ADMIN_MEDIA_PREFIX

the last line of your stacktrace may have caused the error, but it was caught in a rendering routine that is only telling you what it was attempting to render when the error was caught, not that the 'true' itself caused the error.

Note: See TracTickets for help on using tickets.
Back to Top