senaite / senaite.jsonapi

RESTful JSON API for SENAITE
https://www.senaite.com
GNU General Public License v2.0
11 stars 20 forks source link

Null values are saved as 'NOW' in Date Time Fields #25

Closed nihadness closed 6 years ago

nihadness commented 6 years ago

Current behavior before PR

Setters of DateTimeFieldManager and DatetimeFieldManager always tries to convert the incoming value to DateTime/datetime types. It is a problem when incoming value is None or an empty string. Then values are set as NOW.

Desired behavior after PR is merged

Null values are saved as None in DateTimeFields.

-- I confirm I have tested the PR thoroughly and coded it according to PEP8 standards.