mirror of
https://github.com/ansible/awx.git
synced 2026-02-19 04:00:06 -03:30
Merge pull request #1360 from anoek/rbac
Fixed up unified jobs/job templates api endpoints
This commit is contained in:
@@ -1054,12 +1054,16 @@ class UnifiedJobTemplateAccess(BaseAccess):
|
|||||||
'last_job',
|
'last_job',
|
||||||
'current_job',
|
'current_job',
|
||||||
)
|
)
|
||||||
qs = qs.prefetch_related(
|
|
||||||
#'project',
|
# WISH - sure would be nice if the following worked, but it does not.
|
||||||
'inventory',
|
# In the future, as django and polymorphic libs are upgraded, try again.
|
||||||
'credential',
|
|
||||||
'cloud_credential',
|
#qs = qs.prefetch_related(
|
||||||
)
|
# 'project',
|
||||||
|
# 'inventory',
|
||||||
|
# 'credential',
|
||||||
|
# 'cloud_credential',
|
||||||
|
#)
|
||||||
|
|
||||||
return qs.all()
|
return qs.all()
|
||||||
|
|
||||||
@@ -1089,20 +1093,26 @@ class UnifiedJobAccess(BaseAccess):
|
|||||||
)
|
)
|
||||||
qs = qs.prefetch_related(
|
qs = qs.prefetch_related(
|
||||||
'unified_job_template',
|
'unified_job_template',
|
||||||
'project',
|
|
||||||
'inventory',
|
|
||||||
'credential',
|
|
||||||
'job_template',
|
|
||||||
'inventory_source',
|
|
||||||
'cloud_credential',
|
|
||||||
'project___credential',
|
|
||||||
'inventory_source___credential',
|
|
||||||
'inventory_source___inventory',
|
|
||||||
'job_template__inventory',
|
|
||||||
'job_template__project',
|
|
||||||
'job_template__credential',
|
|
||||||
'job_template__cloud_credential',
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
#qs = qs.prefetch_related(
|
||||||
|
# 'project',
|
||||||
|
# 'inventory',
|
||||||
|
# 'credential',
|
||||||
|
# 'job_template',
|
||||||
|
# 'inventory_source',
|
||||||
|
# 'cloud_credential',
|
||||||
|
# 'project___credential',
|
||||||
|
# 'inventory_source___credential',
|
||||||
|
# 'inventory_source___inventory',
|
||||||
|
# 'job_template__inventory',
|
||||||
|
# 'job_template__project',
|
||||||
|
# 'job_template__credential',
|
||||||
|
# 'job_template__cloud_credential',
|
||||||
|
#)
|
||||||
return qs.all()
|
return qs.all()
|
||||||
|
|
||||||
class ScheduleAccess(BaseAccess):
|
class ScheduleAccess(BaseAccess):
|
||||||
|
|||||||
Reference in New Issue
Block a user