Automatically select purchase when adding session

This commit is contained in:
2023-01-16 21:19:20 +01:00
parent 2553d6f9e6
commit e51d586255
4 changed files with 10 additions and 3 deletions

View File

@ -81,7 +81,7 @@ class Session(models.Model):
@property
def last(self) -> Manager[Any]:
return Session.objects.all().order_by("timestamp_start")[:-1]
return Session.objects.all().order_by("timestamp_start")[0]
def save(self, *args, **kwargs):
if self.timestamp_start != None and self.timestamp_end != None: