Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Date Validator fails when value is from DateTime/datetime type
Browse files Browse the repository at this point in the history
  • Loading branch information
xispa committed Jul 6, 2020
1 parent 548039a commit 6cff85e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Changelog

**Fixed**

- #195 Fix Date Validator fails when value is from DateTime/datetime type
- #193 Hide url in ClientPatientID column when value is empty
- #182 Prevent Traceback in patients listing when dob is not set
- #184 Required patient data can be omitted on save causing error on re-edit
Expand Down
3 changes: 3 additions & 0 deletions bika/health/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def __call__(self, value, *args, **kwargs):
if not value and not required:
return True

if api.is_date(value):
return True

try:
datetime.strptime(value, '%Y-%m-%d')
except ValueError:
Expand Down

0 comments on commit 6cff85e

Please sign in to comment.