Fix check for next request date in case last_played is NULL.
This commit is contained in:
parent
09ecf2a0ca
commit
12bce62773
1 changed files with 3 additions and 1 deletions
|
@ -184,7 +184,9 @@ class Song(Disableable, Publishable, Timestampable, models.Model):
|
||||||
Datetime when a song can be requested again.
|
Datetime when a song can be requested again.
|
||||||
"""
|
"""
|
||||||
if self._is_song():
|
if self._is_song():
|
||||||
|
if self.last_played:
|
||||||
return self.last_played + Song.music.wait_total()
|
return self.last_played + Song.music.wait_total()
|
||||||
|
return timezone.now()
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _is_requestable(self):
|
def _is_requestable(self):
|
||||||
|
|
Loading…
Reference in a new issue