sometimes core_filters is not an attribute, so just set it to empty instead of pop

This commit is contained in:
Wayne Witzel III
2017-08-21 06:03:37 -04:00
parent eb6a27653f
commit f8c2b466a8

View File

@@ -40,7 +40,7 @@ class HostManager(models.Manager):
#
# If we don't disable this, a filter of {'inventory': self.instance} gets automatically
# injected by the related object mapper.
self.core_filters.pop('inventory', None)
self.core_filters = {}
qs = qs & q
unique_by_name = qs.order_by('name', 'pk').distinct('name')