Skip to content
Snippets Groups Projects
Commit 862486a5 authored by Ingo Leindecker's avatar Ingo Leindecker
Browse files

Don't allow DELETE shows via API for documentation purposes. Set is_active to False instead.

See #28
parent 493c5fd7
No related branches found
No related tags found
No related merge requests found
......@@ -445,7 +445,7 @@ class APIShowViewSet(viewsets.ModelViewSet):
/api/v1/shows/?active=false Returns all inactive shows (= past or upcoming) (GET)
/api/v1/shows/?host=1 Returns shows assigned to a given host (GET)
/api/v1/shows/?owner=1 Returns shows of a given owner (GET)
/api/v1/shows/1 Used for retrieving a single show or update (if owned) (GET, PUT, DELETE)
/api/v1/shows/1 Used for retrieving a single show or update (if owned) (GET, PUT) - DELETE is not allowed via API. Set is_active to False instead.
/api/v1/shows/1/notes Returns all notes to the show (GET) - POST not allowed at this level, use /shows/1/schedules/1/timeslots/1/note instead
/api/v1/shows/1/notes/1 Returns the note of the show by its ID (GET) - PUT/DELETE not allowed at this level, use /shows/1/schedules/1/timeslots/1/note/1/ instead
/api/v1/shows/1/schedules Returns all schedules of the show (GET, POST)
......@@ -554,6 +554,7 @@ class APIShowViewSet(viewsets.ModelViewSet):
Only superusers may delete shows
"""
"""
if not request.user.is_superuser:
return Response(status=status.HTTP_401_UNAUTHORIZED)
......@@ -561,7 +562,9 @@ class APIShowViewSet(viewsets.ModelViewSet):
Show.objects.get(pk=pk).delete()
return Response(status=status.HTTP_204_NO_CONTENT)
"""
return Response(status=status.HTTP_401_UNAUTHORIZED)
class APIScheduleViewSet(viewsets.ModelViewSet):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment