fix: keep organization identity types exclusive
This commit is contained in:
@@ -519,13 +519,17 @@ class OrganizationSourceIngestionService:
|
||||
if not organization.inn and safe_inn == record.inn:
|
||||
organization.inn = record.inn
|
||||
changed = True
|
||||
if not organization.kpp and record.kpp:
|
||||
has_entrepreneur_identity = bool(organization.ogrip or record.ogrip)
|
||||
has_legal_identity = bool(
|
||||
organization.kpp or organization.ogrn or record.kpp or record.ogrn
|
||||
)
|
||||
if not organization.kpp and record.kpp and not has_entrepreneur_identity:
|
||||
organization.kpp = record.kpp
|
||||
changed = True
|
||||
if not organization.ogrn and record.ogrn:
|
||||
if not organization.ogrn and record.ogrn and not has_entrepreneur_identity:
|
||||
organization.ogrn = record.ogrn
|
||||
changed = True
|
||||
if not organization.ogrip and record.ogrip:
|
||||
if not organization.ogrip and record.ogrip and not has_legal_identity:
|
||||
organization.ogrip = record.ogrip
|
||||
changed = True
|
||||
if cls._should_replace_placeholder_name(organization, record.organization_name):
|
||||
|
||||
Reference in New Issue
Block a user