Code

Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#8577 closed (fixed)

Admin raises UnboundLocalError

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

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 6 years ago.

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by evenrik

comment:1 Changed 6 years ago by evenrik

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from 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 UnboundLocalError to Admin raises UnboundLocalError

comment:2 Changed 6 years ago by evenrik

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 Changed 6 years ago by mtredinnick

  • milestone set to 1.0

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

comment:4 Changed 6 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:5 Changed 3 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.