diff --git a/app/services/council_export.py b/app/services/council_export.py index 9289f2b..80d440a 100644 --- a/app/services/council_export.py +++ b/app/services/council_export.py @@ -13,10 +13,6 @@ def _append(sheet, values): if any(isinstance(value, str) and len(value) > 32767 for value in values): raise ValueError("Text exceeds Excel cell limit") sheet.append(values) - for cell in sheet[sheet.max_row]: - if isinstance(cell.value, str): - # CSV/profile content is text, never an Excel formula or error code. - cell.data_type = "s" def council_xlsx(result: dict) -> bytes: @@ -62,6 +58,9 @@ def council_xlsx(result: dict) -> bytes: sheet.column_dimensions[get_column_letter(column)].width = width for row in sheet: for cell in row: + if isinstance(cell.value, str): + # CSV/profile content is text, never an Excel formula or error code. + cell.data_type = "s" cell.alignment = Alignment(vertical="top", wrap_text=True) for cell in sheet[1]: cell.font = Font(bold=True, color="FFFFFF") diff --git a/app/version.py b/app/version.py index d6c8313..c43f98e 100644 --- a/app/version.py +++ b/app/version.py @@ -1,3 +1,3 @@ -APP_VERSION = "0.13.0" -FRONTEND_VERSION = "0.13.0" -BACKEND_VERSION = "0.13.0" +APP_VERSION = "0.13.1" +FRONTEND_VERSION = "0.13.1" +BACKEND_VERSION = "0.13.1" diff --git a/pyproject.toml b/pyproject.toml index bd4b9be..8c50b46 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "miem-workers" -version = "0.13.0" +version = "0.13.1" 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 9249e50..e386d0f 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -18,7 +18,7 @@ def test_health_returns_versions(): response = TestClient(app).get("/api/health") assert response.status_code == 200 - assert response.json()["backend_version"] == "0.13.0" + assert response.json()["backend_version"] == "0.13.1" def test_api_employees_and_stats_require_admin_session(): diff --git a/tests/test_council.py b/tests/test_council.py index fe4c7af..c681ac4 100644 --- a/tests/test_council.py +++ b/tests/test_council.py @@ -5,13 +5,15 @@ from zipfile import ZipFile import pytest from fastapi.testclient import TestClient -from openpyxl import load_workbook +from openpyxl import Workbook, load_workbook +from openpyxl.worksheet.worksheet import Worksheet from sqlalchemy.exc import OperationalError from app.db import get_db from app.main import app from app.models import Employee, EmployeePublication from app.services import council +from app.services.council_export import _append @pytest.fixture() @@ -209,7 +211,7 @@ def test_public_page_data_minimization_and_safe_links(db_session, export): assert "<script>" in response.text and "