Opened 15 years ago

Closed 14 years ago

Last modified 12 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 14 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 by Greg Brown, 15 years ago

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

comment:2 by Russell Keith-Magee, 14 years ago

milestone: 1.2
Triage Stage: UnreviewedAccepted

comment:3 by Russell Keith-Magee, 14 years ago

Component: Uncategorizeddjango.contrib.admin

comment:4 by matiasb, 14 years ago

Owner: changed from nobody to matiasb
Status: newassigned

comment:5 by matiasb, 14 years ago

Has patch: set

added patch

by matiasb, 14 years ago

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

comment:6 by Alex Gaynor, 14 years ago

Triage Stage: AcceptedReady for checkin

comment:7 by anonymous, 14 years ago

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

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

(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 by Jacob, 12 years ago

milestone: 1.2

Milestone 1.2 deleted

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