Fix: Fingerprint was ignoring the time aspect which is obviously very important
This commit is contained in:
parent
bc61eeacd3
commit
48ec2df10d
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user