Opened 16 years ago
Closed 16 years ago
#11682 closed (fixed)
[soc2009/admin-ui] index can be 0 causing saving model with inlines to fail
| Reported by: | Fred Bartle | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.admin | Version: | soc2009/admin-ui |
| Severity: | Keywords: | admin-ui | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
In forms/models.py r11400
678 try: 679 if index: 680 pk_value = self.get_queryset()[index].pk 681 else: 682 pk_value = None 683 except IndexError: 684 pk_value = None
'index' can be zero and therefore evaluate to False, pk_value is set to None, and the hidden AutoField is rendered without a pk value, causing a save to fail.
I did not see soc2009/admin-ui in version dropdown, so I left version empty.
Attachments (1)
Change History (4)
by , 16 years ago
| Attachment: | admin-ui-11682.diff added |
|---|
comment:1 by , 16 years ago
| Has patch: | set |
|---|
Not sure if this is the place to be filing tickets for SoC projects.
comment:2 by , 16 years ago
| Keywords: | admin-ui added |
|---|---|
| Version: | → soc2009/admin-ui |
Note:
See TracTickets
for help on using tickets.
Check if index is not None