Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#16716 closed Bug (fixed)

Regression in admin changelist with failing related admin filters

Reported by: Julien Phalip Owned by: nobody
Component: contrib.admin Version: 1.3
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Aymeric Augustin)

This issue was collaterally revealed by the report in #16714. When an admin filter spanning relationships is invalid (e.g. "?nonexistentrelated__blah=9999", or "?existentrelated__nonexistentfield=9999"), the changelist simply crashes and returns a 500 page. Up to Django 1.3, such an anomaly would cause a 302 redirection (accompanied with the "?e=1" querystring) instead of crashing.

This regression possibly occurred when the Changelist class was slightly modified to build the custom admin filters feature.

Change History (5)

comment:1 by Aymeric Augustin, 13 years ago

Description: modified (diff)
Triage Stage: UnreviewedAccepted

Fixed formatting:)

comment:2 by Julien Phalip, 13 years ago

Severity: NormalRelease blocker

comment:3 by Julien Phalip, 13 years ago

OK, actually the regression only affects the case of "?nonexistantrelated__blah=xxxxx". I'll push a fix for that soon.

The case of "?existantrelated__nonexistantfield=xxxxx" also crashes but that problem exists in 1.2 and 1.3 too, so it's not a regression. I'll create a separate ticket for that.

comment:4 by Julien Phalip, 13 years ago

Resolution: fixed
Status: newclosed

In [16705]:

Fixed #16716 -- Fixed two small regressions in the development version introduced in r16144 where the changelist crashed with a 500 error instead of nicely operating a 302 redirection back to the changelist.

The two specific cases were:

  • a lookup through a non-existing field and apparently spanning multiple relationships (e.g. "?nonexistantwhatever=xxxx").
  • a proper list_filter's queryset failing with an exception. In Django 1.3 the queryset was only directly manipulated by the changelist, whereas in 1.4 the list_filters may manipulate the queryset themselves. The fix here implies catching potential failures from the list_filters too.

comment:5 by Julien Phalip, 12 years ago

Note that the issue reported here was later properly fixed in [17763].

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