1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

add websockets suppor8

This commit is contained in:
MoonTestUse1
2025-01-05 02:27:24 +06:00
parent 143a8ca482
commit 7f94d3e7f8
2 changed files with 24 additions and 7 deletions

View File

@@ -84,10 +84,17 @@ def get_statistics(db: Session) -> dict:
.all()
)
# Формируем словарь статусов
by_status = {}
# Формируем словарь статусов с преобразованием в нижний регистр
by_status = {
'new': 0,
'in_progress': 0,
'completed': 0,
'rejected': 0
}
for status, count in status_counts:
by_status[status] = count
status_key = status.lower() if isinstance(status, str) else status.value.lower()
by_status[status_key] = count
# Возвращаем статистику в нужном формате
return {