Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#14312 closed (fixed)

list_editable causes 500s for ?p>maximum

Reported by: Vlada Macek Owned by: nobody
Component: contrib.admin Version: dev
Severity: Keywords: sprintnov13
Cc: t.django@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When there is list_editable defined in ModelAdmin && there is pagination active (there exist more than one page of objects) && user requests page beyond the last one, exception is raised:

AttributeError: 'tuple' object has no attribute 'ordered'

Full traceback attached.

Presumably the reason is: The cl.result_list is an empty tuple since the InvalidPage exception handler in ChangeList.get_results, but it's expected to be a queryset by a FormSet constructor (options.py:1057).

Attachments (3)

AttributeError_for_list_editable.html (106.8 KB ) - added by Vlada Macek 14 years ago.
full HTML debugging traceback
fix14312-1.patch (2.0 KB ) - added by Matthias Kestenholz 14 years ago.
fix14312-2.patch (2.2 KB ) - added by Matthias Kestenholz 14 years ago.

Download all attachments as: .zip

Change History (9)

by Vlada Macek, 14 years ago

full HTML debugging traceback

comment:1 by Matthias Kestenholz, 14 years ago

Has patch: set
milestone: 1.3
Triage Stage: UnreviewedAccepted

I see two possible approaches to fix this problem:

  1. Return an EmptyQuerySet instead of a tuple. The changelist still shows up, but is empty (at least it does not crash).
  1. Raise an IncorrectLookupParameters exception, all GET parameters are reset.

Assigning milestone 1.3, because this is a reproducible bug which always crashes with a 500 Internal Server Error.

by Matthias Kestenholz, 14 years ago

Attachment: fix14312-1.patch added

by Matthias Kestenholz, 14 years ago

Attachment: fix14312-2.patch added

comment:2 by Gregor Müllegger, 14 years ago

Triage Stage: AcceptedReady for checkin

Looks good to me. Seems to be ready for checkin.

comment:3 by steph, 14 years ago

Keywords: sprintnov13 added

comment:4 by Jannis Leidel, 14 years ago

Resolution: fixed
Status: newclosed

(In [14889]) Fixed #14312 -- Raising an IncorrectLookupParameters if the page number given to an admin change list exceeds the number of the last page. Thanks, mk.

comment:5 by Jannis Leidel, 14 years ago

(In [14908]) [1.2.X] Fixed #14312 -- Raising an IncorrectLookupParameters if the page number given to an admin change list exceeds the number of the last page. Thanks, mk.

Backport from trunk (r14889).

comment:6 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

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