diff --git a/aircox/models.py b/aircox/models.py index a807fbc..0ea5dc9 100755 --- a/aircox/models.py +++ b/aircox/models.py @@ -298,7 +298,7 @@ class Station(Nameable): # one. partial = logs.filter( date__gt = diff.start, date__lt = diff.end - ) + ).last() if partial: next_log = logs.filter(pk__gt = partial.pk).first() if not next_log or next_log.date > diff.end: