Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#12550 closed (fixed)

DecimalField with null=True causes exception in admin list

Reported by: Jacques Beaurain <jacques.beaurain@…> Owned by: Brian Rosner
Component: contrib.admin Version: 1.2-alpha
Severity: Keywords:
Cc: jacques.beaurain@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Tracked it down to a regression introduce by changes for ticket #7980.

This is the exception:

TypeError: float() argument must be a string or a number

Note that this only happens if a record in the results contains a null in this field.
Patch attached.

Attachments (3)

django1.2nulldecimal.patch (727 bytes ) - added by Jacques Beaurain <jacques.beaurain@…> 15 years ago.
Patch fixes exception
django_nullvalue_adminlist_display.patch (2.5 KB ) - added by Jacques Beaurain <jacques.beaurain@…> 15 years ago.
Patch for other fields too and includes regression test.
django_nullvalue_adminlist_display.2.patch (3.4 KB ) - added by Jacques Beaurain <jacques.beaurain@…> 15 years ago.
Better patch for flatchoices and one more type

Download all attachments as: .zip

Change History (10)

by Jacques Beaurain <jacques.beaurain@…>, 15 years ago

Attachment: django1.2nulldecimal.patch added

Patch fixes exception

comment:1 by Karen Tracey, 15 years ago

Needs tests: set

comment:2 by Jacques Beaurain <jacques.beaurain@…>, 15 years ago

Cc: jacques.beaurain@… added

by Jacques Beaurain <jacques.beaurain@…>, 15 years ago

Patch for other fields too and includes regression test.

comment:3 by Jacques Beaurain <jacques.beaurain@…>, 15 years ago

Needs tests: unset

comment:4 by Jannis Leidel, 15 years ago

Actually this looks more like a regression after the admin-readonly stuff in [11965].

by Jacques Beaurain <jacques.beaurain@…>, 15 years ago

Better patch for flatchoices and one more type

comment:5 by Brian Rosner, 15 years ago

Owner: changed from nobody to Brian Rosner
Status: newassigned
Triage Stage: UnreviewedAccepted

comment:6 by Brian Rosner, 15 years ago

Resolution: fixed
Status: assignedclosed

(In [12148]) Fixed #12550 -- better handling with choices and null fields when displaying read-only values

Thanks Jacques Beaurain for the report and patch.

comment:7 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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