#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)
Change History (9)
by , 14 years ago
Attachment: | AttributeError_for_list_editable.html added |
---|
comment:1 by , 14 years ago
Has patch: | set |
---|---|
milestone: | → 1.3 |
Triage Stage: | Unreviewed → Accepted |
I see two possible approaches to fix this problem:
- Return an EmptyQuerySet instead of a tuple. The changelist still shows up, but is empty (at least it does not crash).
- 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 , 14 years ago
Attachment: | fix14312-1.patch added |
---|
by , 14 years ago
Attachment: | fix14312-2.patch added |
---|
comment:2 by , 14 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Looks good to me. Seems to be ready for checkin.
comment:3 by , 14 years ago
Keywords: | sprintnov13 added |
---|
comment:4 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
full HTML debugging traceback