made changes to handle nonetypes
This commit is contained in:
parent
42e3c2c221
commit
7434f2676d
|
@ -206,7 +206,7 @@ def surplus(
|
||||||
# location["address"].get("railway"),
|
# location["address"].get("railway"),
|
||||||
(
|
(
|
||||||
location["address"].get("building")
|
location["address"].get("building")
|
||||||
if (
|
if (location["address"].get("building") and
|
||||||
location["address"].get("building")
|
location["address"].get("building")
|
||||||
!= location["address"].get("house_number")
|
!= location["address"].get("house_number")
|
||||||
)
|
)
|
||||||
|
@ -222,7 +222,7 @@ def surplus(
|
||||||
", " + location["address"].get("suburb", "")
|
", " + location["address"].get("suburb", "")
|
||||||
# dont repeat if suburb is mentioned in the road itself
|
# dont repeat if suburb is mentioned in the road itself
|
||||||
# 'Toa Payoh' in 'Lorong 1A Toa Payoh'
|
# 'Toa Payoh' in 'Lorong 1A Toa Payoh'
|
||||||
if location["address"].get("suburb", "")
|
if location["address"].get("suburb", "") and location["address"].get("suburb", "")
|
||||||
not in location["address"].get("road")
|
not in location["address"].get("road")
|
||||||
else ""
|
else ""
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue