Skip to content

Commit 5b99f63

Browse files
author
Juan Benitez
committed
adding serializers class and permissions class to movie vies
1 parent a691429 commit 5b99f63

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Only authenticated users can use the API services, for that reason if we try thi
4646
```
4747
we get:
4848
```
49-
{ "detail": "Authentication credentials were not provided." }
49+
{ "detail": "You must be authenticated" }
5050
```
5151
Instead, if we try to access with credentials:
5252
```

movies/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from .serializers import MovieSerializer
77

88
class get_delete_update_movie(RetrieveUpdateDestroyAPIView):
9+
serializer_class = MovieSerializer
910
permission_classes = (IsAuthenticated, IsOwnerOrReadOnly,)
1011

1112
def get_queryset(self, pk):
@@ -62,7 +63,7 @@ def delete(self, request, pk):
6263

6364
class get_post_movies(ListCreateAPIView):
6465
serializer_class = MovieSerializer
65-
#permission_classes = (IsAuthenticated,)
66+
permission_classes = (IsAuthenticated,)
6667
# Get all movies
6768

6869
def get_queryset(self):

0 commit comments

Comments
 (0)