forked from expo/troggle
make more robust
This commit is contained in:
parent
af552a3d62
commit
72a6b091e6
@ -318,9 +318,12 @@ class Entrance(TroggleModel):
|
|||||||
except:
|
except:
|
||||||
stations = SurvexStation.objects.filter(name = station)
|
stations = SurvexStation.objects.filter(name = station)
|
||||||
print(f" # MULTIPLE stations found with same name '{station}' in Entrance {self}:")
|
print(f" # MULTIPLE stations found with same name '{station}' in Entrance {self}:")
|
||||||
for s in stations:
|
if len(stations) > 1:
|
||||||
print(f" # {s.id=} - {s.name} {s.latlong()}") # .id is Django internal field, not one of ours
|
for s in stations:
|
||||||
return stations[0]
|
print(f" # {s.id=} - {s.name} {s.latlong()}") # .id is Django internal field, not one of ours
|
||||||
|
return stations[0]
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
def exact_location(self):
|
def exact_location(self):
|
||||||
return self.single(self.exact_station)
|
return self.single(self.exact_station)
|
||||||
|
Loading…
Reference in New Issue
Block a user