Fix check for next request date in case last_played is NULL.

This commit is contained in:
Josh Washburne 2018-03-30 12:35:02 -04:00
parent 09ecf2a0ca
commit 12bce62773

View file

@ -184,7 +184,9 @@ class Song(Disableable, Publishable, Timestampable, models.Model):
Datetime when a song can be requested again.
"""
if self._is_song():
return self.last_played + Song.music.wait_total()
if self.last_played:
return self.last_played + Song.music.wait_total()
return timezone.now()
return None
def _is_requestable(self):