Skip to content

Commit f13293d

Browse files
committed
Solved issue BU-ISCIII#305 Not validated when date in sample project fields contatins also the time
1 parent 76bd975 commit f13293d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/utils/samples.py

+4
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,10 @@ def validate_project_data(project_data, project_name, sample_validation=False):
413413
sample_dict["Validation error"].append(" ".join(error_cause))
414414
"""
415415
if field_type == "Date" and sample[field_name] != "":
416+
# if field contains also time, then removed it
417+
sample[field_name] = re.sub(
418+
r"\s\d{2}:\d{2}:\d{2}", "", sample[field_name]
419+
)
416420
try:
417421
datetime.datetime.strptime(sample[field_name], "%Y-%m-%d")
418422
except Exception:

0 commit comments

Comments
 (0)