Merge pull request #5972 from jainnikhil30/fix_smartinv_duplicate_hosts

fix smart inventory duplicate hosts

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-03-03 16:03:13 +00:00 committed by GitHub
commit c1bfcd73fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,8 +78,7 @@ class HostManager(models.Manager):
self.core_filters = {}
qs = qs & q
unique_by_name = qs.order_by('name', 'pk').distinct('name')
return qs.filter(pk__in=unique_by_name)
return qs.order_by('name', 'pk').distinct('name')
return qs