Различать число распознанных записей и отсутствие данных
This commit is contained in:
1 parent
8dde82ab8a
commit
41467471e2
2 files changed
+3
-2
No files matched your search
@@ -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"),
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
</div>
|
||||
{% else %}
|
||||
{% if section.type == "additional_education" and section.list_items %}
|
||||
<p class="employee-section__note">Всего: {{ section.list_items | length }}</p>
|
||||
<p class="employee-section__note">Распознано записей: {{ section.list_items | length }}</p>
|
||||
{% endif %}
|
||||
{% if section.paragraphs %}
|
||||
{% for paragraph in section.paragraphs %}
|
||||
|
||||
Reference in new issue
Block a user