From 520c1df4f3598ad8664f7d5602d6cd199167bfc1 Mon Sep 17 00:00:00 2001 From: codex Date: Fri, 27 Nov 2026 12:24:26 +0300 Subject: [PATCH 1/2] =?UTF-8?q?=D0=A1=D0=BE=D0=BA=D1=80=D0=B0=D1=82=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B7=D0=B0=D0=B3=D0=BE=D0=BB=D0=BE=D0=B2=D0=BE?= =?UTF-8?q?=D0=BA=20=D0=B8=20=D1=88=D0=B8=D1=80=D0=B8=D0=BD=D1=83=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BB=D0=BE=D0=BD=D0=BA=D0=B8=20=D0=94=D0=9F=D0=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/admin_data.py | 2 +- app/services/directory_export.py | 2 +- app/static/admin.css | 5 +++++ app/version.py | 6 +++--- pyproject.toml | 2 +- tests/test_api.py | 13 ++++++++++++- tests/test_council.py | 2 +- 7 files changed, 24 insertions(+), 8 deletions(-) diff --git a/app/services/admin_data.py b/app/services/admin_data.py index 762bd69..d2cd2c7 100644 --- a/app/services/admin_data.py +++ b/app/services/admin_data.py @@ -41,7 +41,7 @@ DIRECTORY_COLUMNS = ( ("last_seen_at", "Последний раз найден", "last_seen_display"), ("dismissed_at", "Дата увольнения", "dismissed_display"), ("profile", "Профиль", "canonical_url"), - ("dpo_count", "Количество ДПО", "dpo_count"), + ("dpo_count", "ДПО", "dpo_count"), ) _TRAINING_LABEL = "повышение квалификации" diff --git a/app/services/directory_export.py b/app/services/directory_export.py index 69193a7..0690cef 100644 --- a/app/services/directory_export.py +++ b/app/services/directory_export.py @@ -19,7 +19,7 @@ def directory_xlsx(employees: list[dict]) -> bytes: (employee[key] or "Без имени") if key == "full_name" else employee[key] for _, _, key in DIRECTORY_COLUMNS ]) - for cell, width in zip(sheet[1], (34, 20, 48, 14, 28, 22, 34, 30, 14, 10, 10, 22, 24, 22, 46, 18)): + for cell, width in zip(sheet[1], (34, 20, 48, 14, 28, 22, 34, 30, 14, 10, 10, 22, 24, 22, 46, 10)): cell.font = Font(bold=True) sheet.column_dimensions[get_column_letter(cell.column)].width = width sheet.freeze_panes = "A2" diff --git a/app/static/admin.css b/app/static/admin.css index b6533ff..8bfa246 100644 --- a/app/static/admin.css +++ b/app/static/admin.css @@ -796,6 +796,11 @@ vertical-align: top; } +.directory-table [data-column="dpo_count"] { + width: 4rem; + white-space: nowrap; +} + .directory-table .badge { white-space: nowrap; } diff --git a/app/version.py b/app/version.py index 8575fe8..8d1ee50 100644 --- a/app/version.py +++ b/app/version.py @@ -1,3 +1,3 @@ -APP_VERSION = "2.4.1" -FRONTEND_VERSION = "2.4.1" -BACKEND_VERSION = "2.4.1" +APP_VERSION = "2.4.3" +FRONTEND_VERSION = "2.4.3" +BACKEND_VERSION = "2.4.3" diff --git a/pyproject.toml b/pyproject.toml index 87443dc..f8c0ad6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "miem-workers" -version = "2.4.1" +version = "2.4.3" description = "MIEM employees parser, admin API, and web admin" requires-python = ">=3.11" dependencies = [ diff --git a/tests/test_api.py b/tests/test_api.py index be73d4a..b163309 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -22,7 +22,7 @@ def test_health_returns_versions(): response = TestClient(app).get("/api/health") assert response.status_code == 200 - assert response.json()["backend_version"] == "2.4.1" + assert response.json()["backend_version"] == "2.4.3" def test_api_employees_and_stats_require_admin_session(): @@ -168,6 +168,10 @@ def test_directory_export_uses_applied_filters_and_sort_across_pages(db_session) status="dismissed" if number == 28 else "active", current_data={ "hse_start_year": 2025 - number, + "sections": [ + {"type": "courses_by_year", "courses": [{"title": "Физика"}]}, + {"type": "additional_education", "education_format": 2, "items": ["Курс А", "Курс Б"]}, + ], "positions": ["Инженер" if number == 29 else "Кафедра физики"], "contacts": {"address": "=1+1", "phones": ["+7 123"]}, }, @@ -202,6 +206,13 @@ def test_directory_export_uses_applied_filters_and_sort_across_pages(db_session) assert [cell.value for cell in sheet[1]] == [ cell.get_text(strip=True) for cell in page.select(".directory-table th") ] + assert page.select_one('th[data-column="dpo_count"]').get_text(strip=True) == "ДПО" + assert page.select_one('td[data-column="dpo_count"]').get_text(strip=True) == "2" + columns = {cell.value: cell for cell in sheet[1]} + dpo = columns["ДПО"] + assert sheet.cell(2, dpo.column).value == 2 + assert sheet.cell(2, columns["Преподаваемые курсы"].column).value == 1 + assert sheet.column_dimensions[dpo.column_letter].width == 10 assert sheet.max_column == 16 assert [cell.value for cell in sheet["A"][1:]] == [f"Export {number:02d}" for number in range(28)] assert [cell.value for cell in sheet["A"][-3:]] == [ diff --git a/tests/test_council.py b/tests/test_council.py index 33e054a..4b6fe9e 100644 --- a/tests/test_council.py +++ b/tests/test_council.py @@ -230,7 +230,7 @@ def test_public_page_data_minimization_and_safe_links(db_session, export): assert "javascript:" not in fragment.text and "private@example.org" not in fragment.text assert "javascript:" not in response.text and "private@example.org" not in response.text assert "/admin/employees/" not in response.text and "/admin/logout" not in response.text - assert "Backend 2.4.1 · Frontend 2.4.1" in response.text + assert "Backend 2.4.3 · Frontend 2.4.3" in response.text assert "Вход в систему" in response.text assert client.get("/admin/directory", follow_redirects=False).status_code in (302, 303, 401, 403) assert "Сотрудники не найдены" in client.get("/admin/council?q=missing").text -- 2.54.0 From 0bbf82004bf007ae670ace22a445cf33b23c872e Mon Sep 17 00:00:00 2001 From: codex Date: Fri, 27 Nov 2026 12:45:25 +0300 Subject: [PATCH 2/2] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20=D0=B6=D1=83=D1=80=D0=BD=D0=B0=D0=BB=20=D0=B8=D0=B7?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D0=B9=202.4.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f4178b..e7cb90b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2.4.3 + +- В справочнике и XLSX колонка с числом пройденных курсов называется «ДПО» и занимает меньше места. + ## 2.4.1 - В карточке сотрудника убрана служебная сводка подтверждения ДПО. Сохранённые курсы доступны в редакторе списка. -- 2.54.0