From 7c352eb2e2e90ca3a8c460ff73d70f873119db6b Mon Sep 17 00:00:00 2001 From: tanshu Date: Sun, 21 Nov 2021 11:50:53 +0530 Subject: [PATCH] Fix: Fingerprints were ignoring the time and only recording the date --- brewman/brewman/routers/fingerprint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brewman/brewman/routers/fingerprint.py b/brewman/brewman/routers/fingerprint.py index e73629ba..36157a28 100644 --- a/brewman/brewman/routers/fingerprint.py +++ b/brewman/brewman/routers/fingerprint.py @@ -37,7 +37,7 @@ def upload_prints( for id_, code in db.execute(select(Employee.id, Employee.code)).all(): employees[code] = id_ file_data = read_file(fingerprints) - prints = [d for d in fp(file_data, employees) if start <= d.date <= finish] + prints = [d for d in fp(file_data, employees) if start <= d.date.date() <= finish] paged_data = [prints[i : i + 100] for i in range(0, len(prints), 100)] for i, page in enumerate(paged_data): print(f"Processing page {i} of {len(paged_data)}") @@ -90,7 +90,7 @@ def fp(file_data: StringIO, employees: Dict[int, uuid.UUID]) -> List[schemas.Fin for row in reader: try: employee_code = int(row[employee_column]) # EnNo - date_ = datetime.strptime(row[date_column], date_format).date() + date_ = datetime.strptime(row[date_column], date_format) if employee_code in employees.keys(): fingerprints.append( schemas.Fingerprint(