Code

Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#1980 closed defect (fixed)

[patch] type casting for date field contains bug

Reported by: Rudolph Owned by: mtredinnick
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 8 years ago.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by Rudolph

comment:1 Changed 8 years ago by Rudolph

  • Summary changed from type casting for date field contains bug to [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 8 years ago by mtredinnick

  • Owner changed from adrian to mtredinnick

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

  • priority changed from normal to high

Also coming across this bug fairly regularly.

comment:4 Changed 8 years ago by Rudolph

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

comment:5 Changed 8 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.