Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#1980 closed defect (fixed)

[patch] type casting for date field contains bug

Reported by: Rudolph Froger Owned by: Malcolm Tredinnick
Component: Core (Other) Version: dev
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

A DateField with null=True and blank=True returned an error when trying to save it from an edit_inline object. Solved it with the patch provided. If you can't replicate it, I'll try to create a model to do that.

Attachments (1)

datefield_patch.diff (607 bytes ) - added by Rudolph Froger 18 years ago.

Download all attachments as: .zip

Change History (6)

by Rudolph Froger, 18 years ago

Attachment: datefield_patch.diff added

comment:1 by Rudolph Froger, 18 years ago

Summary: type casting for date field contains bug[patch] type casting for date field contains bug

Trying to get some attention for this bug by adding [patch] to the title.

comment:2 by Malcolm Tredinnick, 18 years ago

Owner: changed from Adrian Holovaty to Malcolm Tredinnick

Not sure this is being done in the right place. The value must be set to None as is in this patch, not empty string, for example (the tests pick up that problem). But why don't we have the same problems in DateTimeField? It seems to be working a bit differently. I suspect there might be a deeper bug lurking that lets us get through to this point in the code with the wrong value.

Not committing this yet until I can look into it a bit more.

comment:3 by john@…, 18 years ago

priority: normalhigh

Also coming across this bug fairly regularly.

comment:4 by Rudolph Froger, 18 years ago

Mtredinnick, thanks for planning to look into it. A fix would be really nice.

comment:5 by Malcolm Tredinnick, 18 years ago

Resolution: fixed
Status: newclosed

This was fixed in [3277], but somehow I messed up the "auto-close" portion of the commit message. For the record, the commit message was:

Fixed #1980, #2155 -- made date, time and datetime html2python methods a bit
more consistent in their return values. All three now return None when the
passed in string cannot be converted to the required object (this is assumed
elsewhere).

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