1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Simplify select_related.

This commit is contained in:
Aaron Tan 2016-12-01 15:05:22 -05:00
parent e63716c0bb
commit 9f629048da

View File

@ -1843,12 +1843,11 @@ class UnifiedJobAccess(BaseAccess):
qs = qs.select_related(
'created_by',
'modified_by',
'unified_job_node__workflow_job',
)
qs = qs.prefetch_related(
'unified_job_template',
)
if self.model.spawned_by_workflow:
qs = qs.select_related('unified_job_node__workflow_job')
# WISH - sure would be nice if the following worked, but it does not.
# In the future, as django and polymorphic libs are upgraded, try again.