fix(parsers): disambiguate ROPK organizations by OKPO
All checks were successful
All checks were successful
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user