mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -03:30
Revert isinstance, circular imports due to when the HostManager exists for an Inventory
This commit is contained in:
parent
af35838aff
commit
e46a043213
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user