made changes to handle nonetypes

This commit is contained in:
shamsu07 2023-06-13 19:25:21 +05:30
parent 42e3c2c221
commit 7434f2676d

View file

@ -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 ""
) )