from myapp.serializers import UserSerializer, PasswordSerializer
class UserViewSet(viewsets.ModelViewSet):
class UserViewSet(viewsets.ModelViewSet):
"""
"""
...
@@ -176,7 +177,7 @@ Note that you can use any of the standard attributes or method overrides provide
...
@@ -176,7 +177,7 @@ Note that you can use any of the standard attributes or method overrides provide
permission_classes = [IsAccountAdminOrReadOnly]
permission_classes = [IsAccountAdminOrReadOnly]
def get_queryset(self):
def get_queryset(self):
return request.user.accounts.all()
return self.request.user.accounts.all()
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.
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.