From 2e3e451c35f414ebfc81a5cffbe960f0084e02f8 Mon Sep 17 00:00:00 2001 From: tanshu Date: Fri, 6 Nov 2020 12:56:55 +0530 Subject: [PATCH] Fix: Fingerprint now checked and is working Version bump: v8.2.3 --- brewman/brewman/__version__.py | 2 +- brewman/brewman/routers/fingerprint.py | 12 ++++++------ brewman/pyproject.toml | 2 +- overlord/package.json | 2 +- .../employee-functions/employee-functions.service.ts | 2 +- overlord/src/environments/environment.prod.ts | 2 +- overlord/src/environments/environment.ts | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/brewman/brewman/__version__.py b/brewman/brewman/__version__.py index 50bb51d1..03cda64e 100644 --- a/brewman/brewman/__version__.py +++ b/brewman/brewman/__version__.py @@ -1 +1 @@ -__version__ = "8.2.2" +__version__ = "8.2.3" diff --git a/brewman/brewman/routers/fingerprint.py b/brewman/brewman/routers/fingerprint.py index e2a14c88..c83dd318 100644 --- a/brewman/brewman/routers/fingerprint.py +++ b/brewman/brewman/routers/fingerprint.py @@ -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) diff --git a/brewman/pyproject.toml b/brewman/pyproject.toml index fc9010c0..76978a2c 100644 --- a/brewman/pyproject.toml +++ b/brewman/pyproject.toml @@ -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 "] diff --git a/overlord/package.json b/overlord/package.json index 9348e43b..41640a37 100644 --- a/overlord/package.json +++ b/overlord/package.json @@ -1,6 +1,6 @@ { "name": "overlord", - "version": "8.2.2", + "version": "8.2.3", "scripts": { "ng": "ng", "start": "ng serve", diff --git a/overlord/src/app/employee-functions/employee-functions.service.ts b/overlord/src/app/employee-functions/employee-functions.service.ts index eeaa76de..9de97b49 100644 --- a/overlord/src/app/employee-functions/employee-functions.service.ts +++ b/overlord/src/app/employee-functions/employee-functions.service.ts @@ -21,7 +21,7 @@ export class EmployeeFunctionsService { uploadFingerprints(fingerprintFile: File): Observable { const url = '/api/fingerprint'; const fd = new FormData(); - fd.append('uploadedFile', fingerprintFile); + fd.append('fingerprints', fingerprintFile); return >( this.http .post(url, fd) diff --git a/overlord/src/environments/environment.prod.ts b/overlord/src/environments/environment.prod.ts index a7db7eed..7a4f64f2 100644 --- a/overlord/src/environments/environment.prod.ts +++ b/overlord/src/environments/environment.prod.ts @@ -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', }; diff --git a/overlord/src/environments/environment.ts b/overlord/src/environments/environment.ts index 502d0b85..1c543cdd 100644 --- a/overlord/src/environments/environment.ts +++ b/overlord/src/environments/environment.ts @@ -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', }; /*