Commit 19b846ed authored by ETretyakov's avatar ETretyakov
Browse files

Add only if location identified

parent bbf1c7aa
......@@ -95,7 +95,7 @@ class Loader:
class Affiliation:
id: int
name: str
location: list = None
location: list
geojson_id: int = None
def __eq__(self, other):
......@@ -142,12 +142,13 @@ class Converter:
location.append(0)
break
affiliation = Affiliation(affiliation_id, affiliation_name, location)
registered, self.counter = affiliation.register(self.counter, self.affiliations_integrity, self.affiliations)
if registered:
affiliations.append(affiliation)
else:
affiliations.append(self.affiliations.get(affiliation_id))
if location:
affiliation = Affiliation(affiliation_id, affiliation_name, location)
registered, self.counter = affiliation.register(self.counter, self.affiliations_integrity, self.affiliations)
if registered:
affiliations.append(affiliation)
else:
affiliations.append(self.affiliations.get(affiliation_id))
except ValueError:
print("ValueError")
......
This diff is collapsed.
Supports Markdown
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