Fix cases where '3ALPHA' not found for given TIPLOC

This commit is contained in:
Fred Boniface 2024-11-11 10:22:26 +00:00
parent 129dab5292
commit b0cba1cd57

View File

@ -60,8 +60,10 @@ def create_crs_list_from_stops(stops):
for stop in stops: for stop in stops:
if not stop['isPublic']: if not stop['isPublic']:
continue continue
try:
loc_ref = ob_client.get_loc_ref_codes_by_tiploc(stop['tiploc']) loc_ref = ob_client.get_loc_ref_codes_by_tiploc(stop['tiploc'])
crs_list.append(loc_ref[0]['3ALPHA'])
crs_list.append(loc_ref[0]['3ALPHA']) except Exception as e:
print("Unable to load 3ALPHA for: ", stop['tiploc'])
crs_list.append("---")
return crs_list return crs_list