mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
Simplify select_related.
This commit is contained in:
@@ -1843,12 +1843,11 @@ class UnifiedJobAccess(BaseAccess):
|
|||||||
qs = qs.select_related(
|
qs = qs.select_related(
|
||||||
'created_by',
|
'created_by',
|
||||||
'modified_by',
|
'modified_by',
|
||||||
|
'unified_job_node__workflow_job',
|
||||||
)
|
)
|
||||||
qs = qs.prefetch_related(
|
qs = qs.prefetch_related(
|
||||||
'unified_job_template',
|
'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.
|
# 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.
|
# In the future, as django and polymorphic libs are upgraded, try again.
|
||||||
|
|||||||
Reference in New Issue
Block a user