Skip to content

Commit 3eaad89

Browse files
committed
Docs fix
1 parent ce5e8f8 commit 3eaad89

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/api-guide/viewsets.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ For example:
9999
from django.contrib.auth.models import User
100100
from rest_framework import viewsets
101101
from rest_framework.decorators import action
102-
from myapp.serializers import UserSerializer
102+
from rest_framework.response import Response
103+
from myapp.serializers import UserSerializer, PasswordSerializer
103104

104105
class UserViewSet(viewsets.ModelViewSet):
105106
"""
@@ -176,7 +177,7 @@ Note that you can use any of the standard attributes or method overrides provide
176177
permission_classes = [IsAccountAdminOrReadOnly]
177178

178179
def get_queryset(self):
179-
return request.user.accounts.all()
180+
return self.request.user.accounts.all()
180181

181182
Also note that although this class provides the complete set of create/list/retrieve/update/destroy actions by default, you can restrict the available operations by using the standard permission classes.
182183

0 commit comments

Comments
 (0)