From 950efecb7ef80a93a95722a8a4da2fed06eb68c2 Mon Sep 17 00:00:00 2001 From: bkfox Date: Mon, 9 Jan 2017 16:11:45 +0100 Subject: [PATCH] fix on_air algorithm pbm --- aircox/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aircox/models.py b/aircox/models.py index 4b85fa7..a807fbc 100755 --- a/aircox/models.py +++ b/aircox/models.py @@ -300,7 +300,7 @@ class Station(Nameable): date__gt = diff.start, date__lt = diff.end ) if partial: - next_log = logs.filter(pk__gt = partial_log.pk).first() + next_log = logs.filter(pk__gt = partial.pk).first() if not next_log or next_log.date > diff.end: partial.date = diff.end logs_ = list(logs_[:count]) + [partial]