Commit 01ea09616ba2c99b9940139176d84e4f701c3675
1 parent
7aa4b42d3e
Exists in
master
Don't be silly, you can't log out twice!
Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff
flashcards/views.py
View file @
01ea096
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | from flashcards.models import Section, User |
3 | 3 | from flashcards.serializers import SectionSerializer, UserUpdateSerializer, RegistrationSerializer, UserSerializer, \ |
4 | 4 | PasswordResetSerializer, PasswordResetRequestSerializer, EmailPasswordSerializer |
5 | +from rest_framework.permissions import IsAuthenticated | |
5 | 6 | from rest_framework.viewsets import ReadOnlyModelViewSet |
6 | 7 | from django.core.mail import send_mail |
7 | 8 | from django.contrib.auth import authenticate, login, logout |
... | ... | @@ -115,6 +116,7 @@ |
115 | 116 | |
116 | 117 | |
117 | 118 | class UserLogout(APIView): |
119 | + permission_classes = (IsAuthenticated,) | |
118 | 120 | def post(self, request, format=None): |
119 | 121 | """ |
120 | 122 | Logs the authenticated user out. |