Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#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)

nullbooleanselect_patch.diff (1.5 KB) - added by matiasb 10 years ago.
Fixed _has_changed method of NullBooleanSelect widget to distinguish between None and False (updated)

Download all attachments as: .zip

Change History (11)

comment:1 Changed 10 years ago by Greg Brown

Note - this only occurs when the model is registered in an admin inline.

comment:2 Changed 10 years ago by Russell Keith-Magee

milestone: 1.2
Triage Stage: UnreviewedAccepted

comment:3 Changed 10 years ago by Russell Keith-Magee

Component: Uncategorizeddjango.contrib.admin

comment:4 Changed 10 years ago by matiasb

Owner: changed from nobody to matiasb
Status: newassigned

comment:5 Changed 10 years ago by matiasb

Has patch: set

added patch

Changed 10 years ago by matiasb

Fixed _has_changed method of NullBooleanSelect widget to distinguish between None and False (updated)

comment:6 Changed 10 years ago by Alex Gaynor

Triage Stage: AcceptedReady for checkin

comment:7 Changed 10 years ago by anonymous

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 10 years ago by jkocherhans

Resolution: fixed
Status: assignedclosed

(In [12523]) Fixed #11860. Changed NullBooleanSelect's _has_changed method to repect differences between None and False. Thanks, matiasb.

comment:9 Changed 10 years ago by jkocherhans

(In [12524]) [1.1.X] Fixed #11860. Changed NullBooleanSelect's _has_changed method to repect differences between None and False. Backport of [12523] from trunk.

comment:10 Changed 8 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

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