mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
missing street is not included in address string 🟩
This commit is contained in:
parent
25aa57e4b6
commit
0dd39a63f2
1 changed files with 1 additions and 5 deletions
|
|
@ -16,11 +16,7 @@ def map_plan(mp: MagicPlan) -> Plan:
|
||||||
def _map_address(addr: api.Address | None) -> str | None:
|
def _map_address(addr: api.Address | None) -> str | None:
|
||||||
if addr is None:
|
if addr is None:
|
||||||
return None
|
return None
|
||||||
street = (
|
street = " ".join(p for p in [addr.street_number, addr.street] if p) or None
|
||||||
f"{addr.street_number} {addr.street}".strip()
|
|
||||||
if addr.street_number
|
|
||||||
else addr.street
|
|
||||||
)
|
|
||||||
parts = [p for p in [street, addr.city, addr.country] if p]
|
parts = [p for p in [street, addr.city, addr.country] if p]
|
||||||
return ", ".join(parts) if parts else None
|
return ", ".join(parts) if parts else None
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue