From 416bd576d9d32121b9525d10e40eed6321821496 Mon Sep 17 00:00:00 2001 From: Miwory Date: Mon, 13 Apr 2026 16:41:51 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- src/apps/users/v1/router.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8166a51..df05cba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "HospitalAssistantBackend" -version = "1.4.0" +version = "1.4.1" description = "Backend for Hospital Assistant" readme = "README.md" requires-python = ">=3.13,<3.14" diff --git a/src/apps/users/v1/router.py b/src/apps/users/v1/router.py index fa59106..d352beb 100644 --- a/src/apps/users/v1/router.py +++ b/src/apps/users/v1/router.py @@ -109,11 +109,14 @@ async def get_vaccs_report_download( Get report of vaccinations for user by id. """ if resultId is not None: - model = await c.vitacore_api.getDiagResultFile(resultId) + file = await c.vitacore_api.getDiagResultFile(resultId) else: - model = await c.vitacore_api.getVaccsReport(user.vita_id) + file = await c.vitacore_api.getVaccsReport(user.vita_id) - file_bytes = base64.b64decode(model.content) + if file is None: + raise e.BadRequestException + + file_bytes = base64.b64decode(file.content) filename = f'vaccs_report_{resultId or user.vita_id}.doc' return Response(