From f9e53e64944f9546436772e57368e9087d3ec2b1 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Thu, 2 May 2024 21:03:16 -0400 Subject: [PATCH] fix: Support publishers who incorrectly only publish dates, not datetimes (india_assam_finance_department) --- data_registry/process_manager/task/process.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data_registry/process_manager/task/process.py b/data_registry/process_manager/task/process.py index 5a4c2bd..e215e62 100644 --- a/data_registry/process_manager/task/process.py +++ b/data_registry/process_manager/task/process.py @@ -16,7 +16,10 @@ def url_for_collection(*parts): def parse_date(dt): if dt: - return datetime.strptime(dt, "%Y-%m-%dT%H:%M:%S%z").date() + if len(dt) == 10: + return datetime.strptime(dt, "%Y-%m-%d").date() + else: + return datetime.strptime(dt, "%Y-%m-%dT%H:%M:%S%z").date() return dt