Skip to content

Commit

Permalink
fixes lost emails due to early exit on org entity match
Browse files Browse the repository at this point in the history
  • Loading branch information
vegu committed Mar 25, 2024
1 parent 9b542c6 commit 5119d27
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rdap/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def _parse(self):
emails = set()
org_name = ""
org_address = ""
org_name_final = False

for ent in self._data.get("entities", []):
vcard = self._parse_vcard(ent)
Expand All @@ -113,7 +114,7 @@ def _parse(self):
handle_url = self._rdapc.get_entity_url(handle)

if "registrant" in roles:
if "fn" in vcard:
if "fn" in vcard and not org_name_final:
org_name = vcard["fn"]
if "adr" in vcard:
org_address = vcard["adr"]
Expand All @@ -135,8 +136,8 @@ def _parse(self):
except RdapHTTPError:
if not self._rdapc.config.get("ignore_recurse_errors"):
raise
if "org" in kind:
break
if "org" in kind and org_name:
org_name_final = True

# WORKAROUND APNIC keeps org info in remarks
if "apnic" in self._data.get("port43", ""):
Expand Down

0 comments on commit 5119d27

Please sign in to comment.