diff --git a/app/services/admin_data.py b/app/services/admin_data.py index ab8fa31..9a78a99 100644 --- a/app/services/admin_data.py +++ b/app/services/admin_data.py @@ -125,6 +125,7 @@ def employee_display_payload(employee: Employee, *, sections=None) -> dict[str, phones = _clean_list(contacts.get("phones")) degree_values = academic_degrees(data) education = [s for s in sections if isinstance(s, dict) and s.get("type") == "additional_education"] + dpo_count = sum(len(s.get("items", [])) for s in education) return { "id": employee.id, "full_name": employee.full_name, @@ -141,7 +142,7 @@ def employee_display_payload(employee: Employee, *, sections=None) -> dict[str, "address": contacts.get("address"), "academic_degree_text": "; ".join(degree_values), "publications_count": _count_section_items(sections, "publications"), - "dpo_count": sum(len(s.get("items", [])) for s in education) if education else None, + "dpo_count": dpo_count or None, "dpo_uncertain": any(not s.get("items") or s.get("unresolved") or s.get("unresolved_documents") for s in education), "courses_count": _count_section_items(sections, "courses_by_year"), "news_count": len(stored_news_links) or _count_section_items(sections, "news"), diff --git a/app/templates/employee_detail.html b/app/templates/employee_detail.html index 5b08eb5..8356bea 100644 --- a/app/templates/employee_detail.html +++ b/app/templates/employee_detail.html @@ -216,7 +216,7 @@ {% else %} {% if section.type == "additional_education" and section.list_items %} -

Всего: {{ section.list_items | length }}

+

Распознано записей: {{ section.list_items | length }}

{% endif %} {% if section.paragraphs %} {% for paragraph in section.paragraphs %}