forked from s_ranjbar/city_retrofit
Set usage to unknown if it cannot be determined.
This commit is contained in:
parent
3d883fc068
commit
3a7dccff8c
|
@ -60,8 +60,11 @@ class City(Repository):
|
|||
for building in city.buildings:
|
||||
object_usage = ''
|
||||
for internal_zone in building.internal_zones:
|
||||
for usage in internal_zone.usages:
|
||||
object_usage = f'{object_usage}{usage.name}_{usage.percentage} '
|
||||
if internal_zone is None or internal_zone.usages is None:
|
||||
object_usage = 'Unknown'
|
||||
else:
|
||||
for usage in internal_zone.usages:
|
||||
object_usage = f'{object_usage}{usage.name}_{usage.percentage} '
|
||||
object_usage = object_usage.rstrip()
|
||||
db_city_object = CityObject(db_city.id,
|
||||
building.name,
|
||||
|
|
Loading…
Reference in New Issue
Block a user