Opened 18 years ago
Closed 17 years ago
#3434 closed (invalid)
[newforms-admin] change_stage is broken for models with no editable fields
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | contrib.admin | Version: | newforms-admin |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
render_change_form raises an IndexError (list index out of range)
for models that have no editable fields. This may sound weird, but
it actually makes sense in some situations, ie. for a model that
serves only as a foreignkey target with edit_inline.
I only tested this for the old admin, but from the source code
it appears that the newforms one has the same problem. The patch
is for old admin, but fixing newforms-admin is just as simple.
Attachments (1)
Change History (8)
by , 18 years ago
Attachment: | patch_admin_for_empty_models.patch added |
---|
comment:1 by , 18 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
comment:2 by , 18 years ago
Summary: | [patch] change_stage is broken for models with no editable fields → [newforms-admin] change_stage is broken for models with no editable fields |
---|
Not worth fixing on trunk, since we are close to moving away from existing admin entirely. Applicable to newforms-admin, though.
comment:3 by , 18 years ago
Has patch: | set |
---|---|
Triage Stage: | Ready for checkin → Accepted |
I'm going to hold off on committing this yet until we see how edit_inline functionality pans out in newforms-admin. It might need changing or it might not be a necessary fix at all (the only use-case I can think of is the one mentioned in the ticket summary).
comment:4 by , 17 years ago
Owner: | changed from | to
---|---|
Version: | SVN → newforms-admin |
Reassigning to jkocherhans so he can figure out what needs to be done here.
comment:5 by , 17 years ago
Owner: | changed from | to
---|
Assigning to nobody. I'm not working on this right now, or probably any time soon either. edit_inline is still going to see some big changes.
comment:6 by , 17 years ago
Note: this patch is no longer valid for newforms-admin. The problem is still present in the branch, but now has much less of an impact: you will get javascript error instead of Python exception.
comment:7 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Yeah, edit_inline stuff should now not be prone to this any longer. Closing this ticket since you explicitly tell the ModelAdmin
what inlines to use. If you make an inline with no editable fields then that is a developer problem.
Sort of a fringe case, but it's an easy fix.