mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Empty tenancies, Abri rejections and ambiguous responses resolve like the other relay operations 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
203ffac01f
commit
3dd2dfe92c
1 changed files with 7 additions and 3 deletions
|
|
@ -226,15 +226,19 @@ class AbriClient:
|
|||
|
||||
@staticmethod
|
||||
def _parse_tenancy_data(root: ET.Element) -> TenancyData:
|
||||
tenancy = root.find("Tenancy")
|
||||
tenancies = root.findall("Tenancy")
|
||||
|
||||
if tenancy is None:
|
||||
if len(tenancies) != 1:
|
||||
raise AbriResponseParseError(
|
||||
"Tenancy element missing from relay response"
|
||||
f"expected exactly one Tenancy element, found {len(tenancies)}"
|
||||
)
|
||||
|
||||
tenancy = tenancies[0]
|
||||
tenancy_reference = (tenancy.text or "").strip()
|
||||
|
||||
if not tenancy_reference:
|
||||
raise AbriResponseParseError("Tenancy element missing its reference")
|
||||
|
||||
return TenancyData(
|
||||
tenancy_reference=tenancy_reference,
|
||||
tenants=tuple(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue