Rename variable for less confusion.

This commit is contained in:
Josh W 2020-02-15 13:33:48 -05:00
parent 1af8de36be
commit 98fa88bd20

View file

@ -68,19 +68,19 @@ class NextRequest(RetrieveAPIView):
if [j for j in queued_songs if j.song.is_jingle]: if [j for j in queued_songs if j.song.is_jingle]:
if not SongRequest.music.new_requests().exists(): if not SongRequest.music.new_requests().exists():
random_song = Song.music.get_random_requestable_song() random_song = Song.music.get_random_requestable_song()
next_play = SongRequest.objects.create(profile=dj_profile, next_request = SongRequest.objects.create(profile=dj_profile,
song=random_song) song=random_song)
else: else:
next_play = SongRequest.music.next_request() next_request = SongRequest.music.next_request()
else: else:
random_jingle = Song.music.get_random_jingle() random_jingle = Song.music.get_random_jingle()
next_play = SongRequest.objects.create(profile=dj_profile, next_request = SongRequest.objects.create(profile=dj_profile,
song=random_jingle) song=random_jingle)
next_play.queued_at = timezone.now() next_request.queued_at = timezone.now()
next_play.save(update_fields=['queued_at']) next_request.save(update_fields=['queued_at'])
serializer = GetRequestSerializer(next_play, many=False) serializer = GetRequestSerializer(next_request, many=False)
media_type = request.accepted_renderer.media_type media_type = request.accepted_renderer.media_type
if media_type == 'application/vnd.liquidsoap.annotate': if media_type == 'application/vnd.liquidsoap.annotate':