diff --git a/program/views.py b/program/views.py index 51f95b55d2c2e7426e0aecc4ee27cdbae12f93b8..f28c0c3ef6303449a86993ff71247a0d19acfc01 100644 --- a/program/views.py +++ b/program/views.py @@ -417,9 +417,9 @@ class APIScheduleViewSet(viewsets.ModelViewSet): # First create submit -> return projected timeslots and collisions # TODO: Perhaps directly insert into database if no conflicts found if "solutions" not in request.data: + # TODO: respond with status.HTTP_409_CONFLICT when the dashboard can handle it return Response( Schedule.make_conflicts(request.data["schedule"], pk, show_pk), - status=status.HTTP_409_CONFLICT, ) # Otherwise try to resolve @@ -430,7 +430,8 @@ class APIScheduleViewSet(viewsets.ModelViewSet): return Response(resolution, status=status.HTTP_201_CREATED) # Otherwise return conflicts - return Response(resolution, status=status.HTTP_409_CONFLICT) + # TODO: respond with status.HTTP_409_CONFLICT when the dashboard can handle it + return Response(resolution) def update(self, request, *args, **kwargs): """ @@ -471,9 +472,9 @@ class APIScheduleViewSet(viewsets.ModelViewSet): # First update submit -> return projected timeslots and collisions if "solutions" not in request.data: + # TODO: respond with status.HTTP_409_CONFLICT when the dashboard can handle it return Response( - Schedule.make_conflicts(request.data["schedule"], pk, show_pk), - status=status.HTTP_409_CONFLICT, + Schedule.make_conflicts(request.data["schedule"], pk, show_pk) ) # Otherwise try to resolve @@ -484,7 +485,8 @@ class APIScheduleViewSet(viewsets.ModelViewSet): return Response(resolution) # Otherwise return conflicts - return Response(resolution, status=status.HTTP_409_CONFLICT) + # TODO: respond with status.HTTP_409_CONFLICT when the dashboard can handle it + return Response(resolution) def destroy(self, request, *args, **kwargs): """