fix(parsers): disambiguate ROPK organizations by OKPO
All checks were successful
CI/CD Pipeline / Quality Gate (push) Successful in 1m13s
CI/CD Pipeline / Build and Push Images (push) Successful in 18s
CI/CD Pipeline / Internal Notify (push) Successful in 1s
CI/CD Pipeline / Deploy Dev via Compose (push) Successful in 31s

This commit is contained in:
2026-08-20 18:20:48 +02:00
parent 7c50cf82ad
commit c6f313090e
2 changed files with 45 additions and 3 deletions

View File

@@ -159,7 +159,7 @@ def _resolve_organization(
return None, "missing_required_value"
if inn and ogrn:
candidates = list(directory.filter(inn=inn, ogrn=ogrn)[:2])
candidates = list(directory.filter(inn=inn, ogrn=ogrn, okpo=okpo)[:2])
if len(candidates) > 1:
return None, "organization_ambiguous"
if not candidates:
@@ -172,8 +172,6 @@ def _resolve_organization(
else "organization_not_found"
)
organization = candidates[0]
if organization.okpo != okpo:
return None, "identifier_mismatch"
else:
candidates = list(directory.filter(okpo=okpo)[:2])
if len(candidates) > 1: