From e46a043213672cb3fdc9057dee4c4d6f8e64652b Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Tue, 2 May 2017 13:16:53 -0400 Subject: [PATCH] Revert isinstance, circular imports due to when the HostManager exists for an Inventory --- awx/main/managers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/awx/main/managers.py b/awx/main/managers.py index 0969ad311a..2bb1ebece4 100644 --- a/awx/main/managers.py +++ b/awx/main/managers.py @@ -11,6 +11,8 @@ from django.conf import settings from awx.main.utils.filters import DynamicFilter +___all__ = ['HostManager', 'InstanceManager'] + class HostManager(models.Manager): """Custom manager class for Hosts model.""" @@ -27,7 +29,9 @@ class HostManager(models.Manager): set. Use the `host_filter` to generate the queryset for the hosts. """ qs = super(HostManager, self).get_queryset() - if hasattr(self, 'instance') and isinstance(self.instance, models.Inventory): + if (hasattr(self, 'instance') and + hasattr(self.instance, 'host_filter') and + hasattr(self.instance, 'kind')): if self.instance.kind == 'dynamic' and self.instance.host_filter is not None: q = DynamicFilter.query_from_string(self.instance.host_filter) # If we are using host_filters, disable the core_filters, this allows