From 0f5629b514884a4717eea570a2c84efc5c4b2945 Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Tue, 11 May 2021 16:14:55 -0400 Subject: [PATCH 1/2] Add more fields to .only since they get referenced --- awx/main/models/events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/models/events.py b/awx/main/models/events.py index 40f922e1e2..a92c957130 100644 --- a/awx/main/models/events.py +++ b/awx/main/models/events.py @@ -511,7 +511,7 @@ class JobEvent(BasePlaybookEvent): from awx.main.models import Host, JobHostSummary # circular import - all_hosts = Host.objects.filter(pk__in=self.host_map.values()).only('id') + all_hosts = Host.objects.filter(pk__in=self.host_map.values()).only('id', 'name', 'last_job_id', 'last_job_host_summary_id') existing_host_ids = set(h.id for h in all_hosts) summaries = dict() From 164255e516b6d511d108b60f0f4b2d1f950b6a67 Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Tue, 11 May 2021 16:26:12 -0400 Subject: [PATCH 2/2] Remove fields not needed from .only --- awx/main/models/events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/models/events.py b/awx/main/models/events.py index a92c957130..4f07bbb14e 100644 --- a/awx/main/models/events.py +++ b/awx/main/models/events.py @@ -511,7 +511,7 @@ class JobEvent(BasePlaybookEvent): from awx.main.models import Host, JobHostSummary # circular import - all_hosts = Host.objects.filter(pk__in=self.host_map.values()).only('id', 'name', 'last_job_id', 'last_job_host_summary_id') + all_hosts = Host.objects.filter(pk__in=self.host_map.values()).only('id', 'name') existing_host_ids = set(h.id for h in all_hosts) summaries = dict()