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

fix: simplify comparisons

parent 22d30416
No related branches found
No related tags found
No related merge requests found
......@@ -1138,7 +1138,8 @@ class APIScheduleViewSet(viewsets.ModelViewSet):
schedule = self.get_object()
default_playlist_id = request.data.get("schedule").get("default_playlist_id")
if default_playlist_id == "" or default_playlist_id is None:
if default_playlist_id == "":
# "clear" the default_playlist_id if the field has no value
schedule.default_playlist_id = None
else:
......@@ -1151,7 +1152,7 @@ class APIScheduleViewSet(viewsets.ModelViewSet):
schedule.is_repetition = False
last_date = request.data.get("schedule").get("last_date")
if last_date == "" or last_date is None:
if last_date == "":
# "clear" the last_date if the field has no value
schedule.last_date = None
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment