Merge pull request #1330 from AlanCoding/capable_of_anything

New copy fields, clean up user_capabilities logic
This commit is contained in:
Alan Rominger
2018-03-13 12:05:45 -04:00
committed by GitHub
7 changed files with 152 additions and 94 deletions
-7
View File
@@ -356,13 +356,6 @@ class ListAPIView(generics.ListAPIView, GenericAPIView):
def get_queryset(self):
return self.request.user.get_queryset(self.model)
def paginate_queryset(self, queryset):
page = super(ListAPIView, self).paginate_queryset(queryset)
# Queries RBAC info & stores into list objects
if hasattr(self, 'capabilities_prefetch') and page is not None:
cache_list_capabilities(page, self.capabilities_prefetch, self.model, self.request.user)
return page
def get_description_context(self):
if 'username' in get_all_field_names(self.model):
order_field = 'username'