fix: align ci with organization redesign
This commit is contained in:
@@ -260,7 +260,9 @@ class OrganizationDirectoryImportService:
|
||||
if not row or row[0] is None:
|
||||
continue
|
||||
code = OrganizationDirectoryImportService._text(row[0])
|
||||
value = OrganizationDirectoryImportService._text(row[1] if len(row) > 1 else "")
|
||||
value = OrganizationDirectoryImportService._text(
|
||||
row[1] if len(row) > 1 else ""
|
||||
)
|
||||
if code:
|
||||
references[code] = value
|
||||
return references
|
||||
@@ -347,7 +349,9 @@ class OrganizationDirectoryImportService:
|
||||
strict=True,
|
||||
)
|
||||
)
|
||||
second_values = dict(zip(SOURCE_HEADERS, second_prefix + second_tail, strict=True))
|
||||
second_values = dict(
|
||||
zip(SOURCE_HEADERS, second_prefix + second_tail, strict=True)
|
||||
)
|
||||
if cls._text(second_values.get("is")) == cls._text(second_values.get("rn")):
|
||||
second_values["is"] = ""
|
||||
return [first_values, second_values]
|
||||
@@ -360,10 +364,7 @@ class OrganizationDirectoryImportService:
|
||||
rn: Any,
|
||||
expected_count: int,
|
||||
) -> list[Any]:
|
||||
if (
|
||||
len(values) == expected_count + 1
|
||||
and cls._text(values[-2]) == cls._text(rn)
|
||||
):
|
||||
if len(values) == expected_count + 1 and cls._text(values[-2]) == cls._text(rn):
|
||||
return [*values[:-2], values[-1]]
|
||||
return values
|
||||
|
||||
|
||||
@@ -46,13 +46,16 @@ class OrganizationDirectoryResolver:
|
||||
ogrn: object = None,
|
||||
ogrip: object = None,
|
||||
) -> OrganizationIdentity:
|
||||
normalized_inn, normalized_kpp, normalized_ogrn, normalized_ogrip = (
|
||||
normalize_identity_fields(
|
||||
inn=inn,
|
||||
kpp=kpp,
|
||||
ogrn=ogrn,
|
||||
ogrip=ogrip,
|
||||
)
|
||||
(
|
||||
normalized_inn,
|
||||
normalized_kpp,
|
||||
normalized_ogrn,
|
||||
normalized_ogrip,
|
||||
) = normalize_identity_fields(
|
||||
inn=inn,
|
||||
kpp=kpp,
|
||||
ogrn=ogrn,
|
||||
ogrip=ogrip,
|
||||
)
|
||||
return OrganizationIdentity(
|
||||
rn=cls._digits(rn, max_length=20),
|
||||
|
||||
@@ -292,9 +292,11 @@ class OrganizationSourceIngestionService:
|
||||
normalized_records: list[_NormalizedRecordInput],
|
||||
) -> tuple[dict[int, Organization], int]:
|
||||
"""Compatibility wrapper; parser ingestion must not create organizations."""
|
||||
organizations, _skipped_unmatched, _skipped_ambiguous = (
|
||||
cls._resolve_existing_organizations(normalized_records)
|
||||
)
|
||||
(
|
||||
organizations,
|
||||
_skipped_unmatched,
|
||||
_skipped_ambiguous,
|
||||
) = cls._resolve_existing_organizations(normalized_records)
|
||||
return organizations, 0
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user