Skip to content
Snippets Groups Projects
Commit 161db8bb authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

Ensure default_playlist_id is not None

parent 2eacf62e
No related branches found
No related tags found
No related merge requests found
Pipeline #1570 failed
......@@ -475,9 +475,9 @@ class APIScheduleViewSet(viewsets.ModelViewSet):
# If we're updating the default playlist id
# TODO: If nothing else than default_playlist_id, or is_repetition changed -> just save and don't do anything
new_schedule = request.data.get('schedule')
if 'default_playlist_id' in new_schedule:
if default_playlist_id := new_schedule.get('default_playlist_id'):
schedule = get_object_or_404(Schedule, pk=pk, show=show_pk)
schedule.default_playlist_id = int(new_schedule['default_playlist_id'])
schedule.default_playlist_id = int(default_playlist_id)
schedule.save()
serializer = ScheduleSerializer(schedule)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment