Merge pull request #43 from HazardDede/master

Fixes wrong default value behaviour in `Event.time_left`
pull/44/head
Thomas Irgang 2019-01-29 20:22:21 +01:00 zatwierdzone przez GitHub
commit 000a981eb7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -43,12 +43,13 @@ class Event:
self.recurring = False
self.location = None
def time_left(self, time=now()):
def time_left(self, time=None):
"""
timedelta form now to event.
:return: timedelta from now
"""
time = time or now()
return self.start - time
def __lt__(self, other):