Honor the parser's education section type in directory training filters

This commit is contained in:
codex committed 2026-11-24 11:35:59 +00:00
1 parent 3717a00459
commit c9f92086e5
2 files changed
+15 -1

No files matched your search

+2 -1
View File
@@ -55,7 +55,8 @@ def _has_training(data: dict[str, Any], since_year: int | None) -> bool:
section = _as_dict(value)
title = str(section.get("title") or "").casefold().strip().rstrip(":")
dedicated = title in {_TRAINING_LABEL, "курсы повышения квалификации"}
if not dedicated and _TRAINING_LABEL not in (part.strip() for part in title.split("/")):
if (section.get("type") != "additional_education" and not dedicated
and _TRAINING_LABEL not in (part.strip() for part in title.split("/"))):
continue
structured_texts = set()
for value in _as_list(section.get("year_entries")):