Opened 11 years ago

Closed 10 years ago

Last modified 10 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: master
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 11 years ago.

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by Rudolph Froger

Attachment: datefield_patch.diff added

comment:1 Changed 11 years ago by Rudolph Froger

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 Changed 10 years ago by Malcolm Tredinnick

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 Changed 10 years ago by john@…

priority: normalhigh

Also coming across this bug fairly regularly.

comment:4 Changed 10 years ago by Rudolph Froger

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

comment:5 Changed 10 years ago by Malcolm Tredinnick

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