From b14010d2f13606efb334dd4e7e5fe5c2c7a77407 Mon Sep 17 00:00:00 2001 From: Stefan Pratter Date: Mon, 25 Mar 2024 16:31:50 +0000 Subject: [PATCH] handle org address the same way --- rdap/objects.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rdap/objects.py b/rdap/objects.py index 94a05a2..e197021 100644 --- a/rdap/objects.py +++ b/rdap/objects.py @@ -101,6 +101,7 @@ def _parse(self): org_name = "" org_address = "" org_name_final = False + org_address_final = False for ent in self._data.get("entities", []): vcard = self._parse_vcard(ent) @@ -118,8 +119,10 @@ def _parse(self): org_name = vcard["fn"] if "org" in kind: org_name_final = True - if "adr" in vcard: + if "adr" in vcard and not org_address_final: org_address = vcard["adr"] + if "org" in kind: + org_address_final = True # check nested entities for nent in ent.get("entities", []):