2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-08 13:03:46 +00:00

fixed bug from people who did not turn up, optimised parsing a bit

This commit is contained in:
2025-07-21 19:24:14 +02:00
parent b5540fd543
commit 9a3651ed8b
3 changed files with 19 additions and 11 deletions

View File

@@ -144,10 +144,16 @@ class Person(TroggleModel):
return sum([personexpedition.surveyedleglength() for personexpedition in self.personexpedition_set.all()])
def first(self):
return self.personexpedition_set.order_by("-expedition")[0]
if self.personexpedition_set.order_by("-expedition"):
return self.personexpedition_set.order_by("-expedition")[0]
else:
return None
def last(self):
return self.personexpedition_set.order_by("expedition")[0]
if self.personexpedition_set.order_by("expedition"):
return self.personexpedition_set.order_by("expedition")[0]
else:
return None
# moved from personexpedition
def name(self):