Fix: Fingerprint now checked and is working
Version bump: v8.2.3
This commit is contained in:
@ -1 +1 @@
|
||||
__version__ = "8.2.2"
|
||||
__version__ = "8.2.3"
|
||||
|
||||
@ -42,7 +42,7 @@ def upload_prints(
|
||||
for id_, code in db.query(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)}")
|
||||
@ -50,9 +50,9 @@ def upload_prints(
|
||||
pg_insert(Fingerprint)
|
||||
.values(
|
||||
{
|
||||
"FingerprintID": bindparam("id"),
|
||||
"EmployeeID": bindparam("employee_id"),
|
||||
"Date": bindparam("date"),
|
||||
"id": bindparam("id"),
|
||||
"employee_id": bindparam("employee_id"),
|
||||
"date": bindparam("date"),
|
||||
}
|
||||
)
|
||||
.on_conflict_do_nothing(),
|
||||
@ -72,10 +72,10 @@ def upload_prints(
|
||||
|
||||
|
||||
def read_file(input_file: UploadFile):
|
||||
input_file.seek(0)
|
||||
input_file.file.seek(0)
|
||||
output = bytearray()
|
||||
while 1:
|
||||
data = input_file.read(2 << 16)
|
||||
data = input_file.file.read(2 << 16)
|
||||
if not data:
|
||||
break
|
||||
output.extend(data)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "brewman"
|
||||
version = "8.2.2"
|
||||
version = "8.2.3"
|
||||
description = "Accounting plus inventory management for a restaurant."
|
||||
authors = ["tanshu <git@tanshu.com>"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user