Фиксы
All checks were successful
Build And Push / publish (push) Successful in 3m36s

This commit is contained in:
2026-04-15 13:50:19 +03:00
parent ce8b0238ce
commit 80badc38db
4 changed files with 12 additions and 4 deletions

View File

@ -1,6 +1,6 @@
[project]
name = "HospitalAssistantBackend"
version = "1.5.0"
version = "1.5.1"
description = "Backend for Hospital Assistant"
readme = "README.md"
requires-python = ">=3.13,<3.14"

View File

@ -1,3 +1,4 @@
from base64 import b64decode
from logging import getLogger
from fastapi import APIRouter, Response
@ -23,9 +24,10 @@ async def download_file(token: str):
raise e.NotFoundException
data = loads(file_data)
file_bytes = b64decode(data['data'])
return Response(
content=data['data'],
content=file_bytes,
media_type=data['content_type'],
headers={
'Content-Disposition': f'attachment; filename="{data["filename"]}"'

View File

@ -126,7 +126,7 @@ async def get_vaccs_report_download(
{
'filename': filename,
'content_type': 'application/msword',
'data': file_bytes,
'data': base64.b64encode(file_bytes).decode('utf-8'),
}
),
ex=600,
@ -312,7 +312,7 @@ async def get_aemd_file_download(
{
'filename': filename,
'content_type': 'application/pdf',
'data': pdf_bytes,
'data': base64.b64encode(pdf_bytes).decode('utf-8'),
}
),
ex=600,

View File

@ -634,10 +634,16 @@ class ProlongationModel(BaseModel):
title='Дата продления до', examples=['2020-10-25']
)
Post: str = Field(
default='Неизвестный врач',
title='Врач',
examples=['Ахсанова Р.М. (Врач общей практики (семейный врач))'],
)
@field_validator('Post', mode='before')
@classmethod
def set_default_post(cls, v: str | None) -> str:
return v or 'Неизвестный врач'
class PatientELNModel(BaseModel):
PatientSNILS: str | None = Field(