From 81888876a34c69efe47713cb60e91dd136025f32 Mon Sep 17 00:00:00 2001
From: Yoshinori Okuji <yo@nexedi.com>
Date: Wed, 9 May 2007 22:42:26 +0000
Subject: [PATCH] Do not check datetime_out_of_range if a value is empty.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14436 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/FormulatorPatch.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/product/ERP5Form/FormulatorPatch.py b/product/ERP5Form/FormulatorPatch.py
index e767ea9f02..3a68f57634 100644
--- a/product/ERP5Form/FormulatorPatch.py
+++ b/product/ERP5Form/FormulatorPatch.py
@@ -998,11 +998,11 @@ class PatchedDateTimeValidator(DateTimeValidator):
 
         # check if things are within range
         start_datetime = field.get_value('start_datetime')
-        if (start_datetime is not None and
+        if (start_datetime not in (None, '') and
             result < start_datetime):
             self.raise_error('datetime_out_of_range', field)
         end_datetime = field.get_value('end_datetime')
-        if (end_datetime is not None and
+        if (end_datetime not in (None, '') and
             result >= end_datetime):
             self.raise_error('datetime_out_of_range', field)
 
-- 
2.30.9