Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#8577 closed (fixed)

Admin raises UnboundLocalError

Reported by: evenrik Owned by: nobody
Component: contrib.admin Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Traceback (most recent call last):

  File "/usr/lib/python2.3/site-packages/django/core/handlers/base.py", line 86, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/usr/lib/python2.3/site-packages/django/contrib/admin/sites.py", line 175, in root
    return self.app_index(request, url)

  File "/usr/lib/python2.3/site-packages/django/contrib/admin/sites.py", line 392, in app_index
    app_dict = {

UnboundLocalError: local variable 'model_dict' referenced before assignment

Code added in [8474] for #1390 produced this error. The untested patch should fix this.

Attachments (1)

patch.diff (1.6 KB ) - added by evenrik 16 years ago.

Download all attachments as: .zip

Change History (6)

by evenrik, 16 years ago

Attachment: patch.diff added

comment:1 by evenrik, 16 years ago

Summary: Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/django/core/handlers/base.py", line 86, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python2.3/site-packages/django/contrib/admin/sites.py", line 175, in root return self.app_index(request, url) File "/usr/lib/python2.3/site-packages/django/contrib/admin/sites.py", line 392, in app_index app_dict = { Admin raises UnboundLocalErrorAdmin raises UnboundLocalError

comment:2 by evenrik, 16 years ago

The patch also fixes

Traceback (most recent call last):

  File "/usr/lib/python2.3/site-packages/django/core/handlers/base.py", line 86, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/usr/lib/python2.3/site-packages/django/contrib/admin/sites.py", line 175, in root
    return self.app_index(request, url)

  File "/usr/lib/python2.3/site-packages/django/contrib/admin/sites.py", line 401, in app_index
    app_dict['models'].sort(lambda x, y: cmp(x['name'], y['name']))

KeyError: 'models'

comment:3 by Malcolm Tredinnick, 16 years ago

milestone: 1.0

What are the steps I need to take to repeat this traceback?

comment:4 by Malcolm Tredinnick, 16 years ago

Resolution: fixed
Status: newclosed

(In [8607]) Fixed #8577 -- Fixed a couple of indentation errors when viewing the app-index
page in admin. Patch by evenrik.

comment:5 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

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