Commit 43234e21 authored by Albert's avatar Albert
Browse files

fixed an issue when location is not specified

parent 34d39f99
Pipeline #2827 failed with stage
...@@ -15,7 +15,9 @@ class Resource(Entity): ...@@ -15,7 +15,9 @@ class Resource(Entity):
def __init__(self, data = {}): def __init__(self, data = {}):
if 'location' in data: if 'location' in data:
# infere the city/country based on coordinates # infere the city/country based on coordinates
data['location'] = self.get_address(HDict(data['location'])) if 'location' in data and data['location']:
data['location'] = self.get_address(HDict(data['location']))
# infere coordinates from the city/country # infere coordinates from the city/country
#location = get_coordinates(location) #location = get_coordinates(location)
super().__init__(data) super().__init__(data)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment