Fix [cluster] duplicates

This commit is contained in:
niclas 2024-03-12 14:23:11 +01:00
parent 86f3ada396
commit 65470855b3
2 changed files with 12 additions and 8 deletions

View file

@ -442,8 +442,8 @@
]
},
"related": [],
"uuid": "7ee96458-af7b-423e-8300-002a7389e934",
"value": "Special Branch"
"uuid": "e9ae0f01-4042-4cea-abfd-2fa2c7ed6a5b",
"value": "Special Branch (Bahamas)"
},
{
"description": "Financial Intelligence Unit (FIU)",
@ -455,8 +455,8 @@
]
},
"related": [],
"uuid": "23a169a2-c94c-433e-98ba-4d0bb65d99a4",
"value": "Financial Intelligence Unit"
"uuid": "75f6a4ce-7654-40e9-9e8e-8a63dcb46804",
"value": "Financial Intelligence Unit (Bahamas)"
},
{
"description": "NSA National Security Agency",
@ -689,8 +689,8 @@
]
},
"related": [],
"uuid": "23a169a2-c94c-433e-98ba-4d0bb65d99a4",
"value": "Financial Intelligence Unit"
"uuid": "9c5f95f2-2fd3-4d9b-9863-03117fe8b249",
"value": "Financial Intelligence Unit (Barbados)"
},
{
"description": "Criminal Investigations Department (CID)",
@ -4418,8 +4418,8 @@
"country_name": "Sri Lanka"
},
"related": [],
"uuid": "7ee96458-af7b-423e-8300-002a7389e934",
"value": "Special Branch"
"uuid": "f134c0bd-7ff1-43fc-a128-13459623efb0",
"value": "Special Branch (Sri Lanka)"
},
{
"description": "Terrorist Investigation Division",

View file

@ -120,6 +120,10 @@ def get_agencies_from_country(heading, current_country, uuids):
if current_country in ["European Union", "Shanghai Cooperation Organisation"]: # Not a country
country_name = None
# Set names for duplicates
if name in ['Special Branch', 'Financial Intelligence Unit']:
name = f'{name} ({current_country})'
if uuids and name in uuids:
agencies.append(IntelAgency(value=name, uuid=uuids[name], meta=Meta(country=country_code, country_name=country_name, refs=[links], synonyms=synonyms), description=description))