Баг фикс

main
through-your-tears 9 months ago
parent 577ba0a866
commit d13b12839c

@ -42,6 +42,7 @@ MAPPING_DATA = {
def parse_organizations_to_db(data): def parse_organizations_to_db(data):
for k in data.keys(): for k in data.keys():
for obj in data[k]: for obj in data[k]:
try:
OrganizationRepository.create( OrganizationRepository.create(
location=LocationRepository.get_or_create( location=LocationRepository.get_or_create(
coords=Point(float(obj['latitude']), float(obj['longitude'])), coords=Point(float(obj['latitude']), float(obj['longitude'])),
@ -53,4 +54,6 @@ def parse_organizations_to_db(data):
description=obj['description'], description=obj['description'],
category=CategoryRepository.get_by_name(MAPPING_DATA[obj['category']]) category=CategoryRepository.get_by_name(MAPPING_DATA[obj['category']])
) )
except Exception:
pass

Loading…
Cancel
Save