Fix: Fingerprint now checked and is working

Version bump:
 v8.2.3
This commit is contained in:
Amritanshu Agrawal 2020-11-06 12:56:55 +05:30
parent 3e04d69419
commit 2e3e451c35
7 changed files with 12 additions and 12 deletions

View File

@ -1 +1 @@
__version__ = "8.2.2"
__version__ = "8.2.3"

View File

@ -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)

View File

@ -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>"]

View File

@ -1,6 +1,6 @@
{
"name": "overlord",
"version": "8.2.2",
"version": "8.2.3",
"scripts": {
"ng": "ng",
"start": "ng serve",

View File

@ -21,7 +21,7 @@ export class EmployeeFunctionsService {
uploadFingerprints(fingerprintFile: File): Observable<boolean> {
const url = '/api/fingerprint';
const fd = new FormData();
fd.append('uploadedFile', fingerprintFile);
fd.append('fingerprints', fingerprintFile);
return <Observable<boolean>>(
this.http
.post<boolean>(url, fd)

View File

@ -1,5 +1,5 @@
export const environment = {
production: true,
ACCESS_TOKEN_REFRESH_MINUTES: 10, // refresh token 10 minutes before expiry
version: '8.2.2',
version: '8.2.3',
};

View File

@ -5,7 +5,7 @@
export const environment = {
production: false,
ACCESS_TOKEN_REFRESH_MINUTES: 10, // refresh token 10 minutes before expiry
version: '8.2.2',
version: '8.2.3',
};
/*