#11860 closed (fixed)
Changing a NullBooleanField from "unknown" to "no" in the admin does not save
Reported by: | Greg Brown | Owned by: | matiasb |
---|---|---|---|
Component: | contrib.admin | Version: | 1.1 |
Severity: | Keywords: | nullboolean dirty | |
Cc: | 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
This only occurs if the nullboolean is the only thing changed - if I change another field in the form at the same time, it works.
I'm assuming that the problem is that the form isn't being marked as dirty by the nullbooleanfield when it should be.
Attachments (1)
Change History (11)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
milestone: | → 1.2 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 Changed 9 years ago by
Component: | Uncategorized → django.contrib.admin |
---|
comment:4 Changed 9 years ago by
Owner: | changed from nobody to matiasb |
---|---|
Status: | new → assigned |
Changed 9 years ago by
Attachment: | nullbooleanselect_patch.diff added |
---|
Fixed _has_changed method of NullBooleanSelect widget to distinguish between None and False (updated)
comment:6 Changed 9 years ago by
Triage Stage: | Accepted → Ready for checkin |
---|
comment:7 Changed 9 years ago by
One issue with the test might be that the test still passes after if I uncomment all the lines of the _has_changed
method except the return initial != data
line.
comment:8 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note - this only occurs when the model is registered in an admin inline.