Improve how to get queryset from a content type

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-02-22 03:58:48 -04:00
parent ef415ef826
commit 68c67abaa3

View File

@@ -40,7 +40,7 @@ class ACLCreateView(ContentTypeViewMixin, ExternalObjectMixin, SingleObjectCreat
def get_external_object_queryset(self):
# Here we get a queryset the object model for which an ACL will be
# created.
return self.get_content_type().model_class().objects.all()
return self.get_content_type().get_all_objects_for_this_type()
def get_extra_context(self):
return {
@@ -106,7 +106,7 @@ class ACLListView(ContentTypeViewMixin, ExternalObjectMixin, SingleObjectListVie
def get_external_object_queryset(self):
# Here we get a queryset the object model for which an ACL will be
# created.
return self.get_content_type().model_class().objects.all()
return self.get_content_type().get_all_objects_for_this_type()
def get_extra_context(self):
return {