Commit 9376c728 authored by fred's avatar fred

limit schedule sort on date object

parent c5fd3664
......@@ -195,7 +195,7 @@ class Emission(models.Model):
possible_dates = []
for schedule in schedules:
possible_dates.append((schedule.get_next_planned_date(since), schedule))
possible_dates.sort()
possible_dates.sort(key=lambda x: x[0])
return possible_dates[0]
def get_next_planned_date(self, since=None):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment