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 not SongRequest.music.new_requests().exists():
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)
else:
next_play = SongRequest.music.next_request()
next_request = SongRequest.music.next_request()
else:
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)
next_play.queued_at = timezone.now()
next_play.save(update_fields=['queued_at'])
next_request.queued_at = timezone.now()
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
if media_type == 'application/vnd.liquidsoap.annotate':