mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-22 07:11:52 +00:00
make more robust
This commit is contained in:
parent
af552a3d62
commit
72a6b091e6
@ -318,9 +318,12 @@ class Entrance(TroggleModel):
|
||||
except:
|
||||
stations = SurvexStation.objects.filter(name = station)
|
||||
print(f" # MULTIPLE stations found with same name '{station}' in Entrance {self}:")
|
||||
for s in stations:
|
||||
print(f" # {s.id=} - {s.name} {s.latlong()}") # .id is Django internal field, not one of ours
|
||||
return stations[0]
|
||||
if len(stations) > 1:
|
||||
for s in stations:
|
||||
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):
|
||||
return self.single(self.exact_station)
|
||||
|
Loading…
Reference in New Issue
Block a user