From 48ec2df10d69b38e27e20cc461a81f38fee1670d Mon Sep 17 00:00:00 2001 From: Amritanshu Date: Mon, 7 Aug 2023 12:47:57 +0530 Subject: [PATCH] Fix: Fingerprint was ignoring the time aspect which is obviously very important --- brewman/brewman/schemas/fingerprint.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/brewman/brewman/schemas/fingerprint.py b/brewman/brewman/schemas/fingerprint.py index 70f5c0f8..cb814af3 100644 --- a/brewman/brewman/schemas/fingerprint.py +++ b/brewman/brewman/schemas/fingerprint.py @@ -20,11 +20,11 @@ class Fingerprint(BaseModel): @field_validator("date_", mode="before") @classmethod - def parse_date(cls, value: date | str) -> date: - if isinstance(value, date): + def parse_date(cls, value: datetime | str) -> datetime: + if isinstance(value, datetime): return value - return datetime.strptime(value, "%d-%b-%Y").date() + return datetime.strptime(value, "%d-%b-%Y %H:%M") @field_serializer("date_") def serialize_date(self, value: date, info: FieldSerializationInfo) -> str: - return value.strftime("%d-%b-%Y") + return value.strftime("%d-%b-%Y %H:%M")