mirror of
https://github.com/ansible/awx.git
synced 2026-02-24 06:26:00 -03:30
Fix bug from previous commit.
This commit is contained in:
@@ -52,7 +52,10 @@ class GenericAPIView(generics.GenericAPIView, APIView):
|
|||||||
# serializer_class = SerializerClass
|
# serializer_class = SerializerClass
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
return self.request.user.get_queryset(self.model)
|
#if hasattr(self.request.user, 'get_queryset'):
|
||||||
|
# return self.request.user.get_queryset(self.model)
|
||||||
|
#else:
|
||||||
|
return super(GenericAPIView, self).get_queryset()
|
||||||
|
|
||||||
def get_description_context(self):
|
def get_description_context(self):
|
||||||
# Set instance attributes needed to get serializer metadata.
|
# Set instance attributes needed to get serializer metadata.
|
||||||
@@ -71,6 +74,9 @@ class GenericAPIView(generics.GenericAPIView, APIView):
|
|||||||
class ListAPIView(generics.ListAPIView, GenericAPIView):
|
class ListAPIView(generics.ListAPIView, GenericAPIView):
|
||||||
# Base class for a read-only list view.
|
# Base class for a read-only list view.
|
||||||
|
|
||||||
|
def get_queryset(self):
|
||||||
|
return self.request.user.get_queryset(self.model)
|
||||||
|
|
||||||
def get_description_context(self):
|
def get_description_context(self):
|
||||||
opts = self.model._meta
|
opts = self.model._meta
|
||||||
if 'username' in opts.get_all_field_names():
|
if 'username' in opts.get_all_field_names():
|
||||||
|
|||||||
Reference in New Issue
Block a user