mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-02-08 03:07:48 +00:00
cope with zero lat long
This commit is contained in:
@@ -148,12 +148,15 @@ def extract_gps(dict):
|
||||
def extract(gpsifd):
|
||||
if item:=is_present(gpsifd): # walrus
|
||||
n, d = item
|
||||
return n/d
|
||||
if d:
|
||||
return n/d
|
||||
return None
|
||||
|
||||
def rational(tup):
|
||||
nom, denom = tup
|
||||
return nom/denom
|
||||
if denom:
|
||||
return nom/denom
|
||||
return None
|
||||
|
||||
def rationalise(item):
|
||||
df, mf, sf = item
|
||||
@@ -195,7 +198,10 @@ def extract_gps(dict):
|
||||
|
||||
if item := is_present("GPSTimeStamp"):
|
||||
h, m, s = rationalise(item)
|
||||
timestamp_utc = f"{ds} {h:02.0f}:{m:02.0f}:{s:02.0f} +00:00 UTC"
|
||||
if h and m and s:
|
||||
timestamp_utc = f"{ds} {h:02.0f}:{m:02.0f}:{s:02.0f} +00:00 UTC"
|
||||
else:
|
||||
timestamp_utc = f"{ds}"
|
||||
else:
|
||||
timestamp_utc = f"{ds}"
|
||||
|
||||
|
||||
@@ -229,16 +229,10 @@ def load_people_expos():
|
||||
pe_list.append(PersonExpedition(person=p, expedition=expedition, noncaver=noncaver))
|
||||
PersonExpedition.objects.bulk_create(pe_list)
|
||||
|
||||
this_year = current_expo() # side effect of calling current_expo is to create it if needed.
|
||||
ensure_users_are_persons()
|
||||
most_recent = Expedition.objects.all().first()
|
||||
print(most_recent)
|
||||
expedition = most_recent
|
||||
# STOP THIS, read how it works first before re-writing it !
|
||||
if most_recent != current_expo():
|
||||
print(f"{most_recent} != {current_expo()} so we need to create this year's expo")
|
||||
expo_now = Expedition(year=current_expo())
|
||||
# expo_now.save()
|
||||
expedition = expo_now
|
||||
check_new_signups(expedition)
|
||||
# pr.disable()
|
||||
# with open("folk_reader.prof", "w") as f:
|
||||
|
||||
Reference in New Issue
Block a user