mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
Merge pull request #1095 from ryanpetrello/schedule-related-proj-inv
add related links to the inventory and project for a schedule
This commit is contained in:
commit
f391b7ace4
@ -3946,6 +3946,12 @@ class ScheduleSerializer(LaunchConfigurationBaseSerializer, SchedulePreviewSeria
|
|||||||
))
|
))
|
||||||
if obj.unified_job_template:
|
if obj.unified_job_template:
|
||||||
res['unified_job_template'] = obj.unified_job_template.get_absolute_url(self.context.get('request'))
|
res['unified_job_template'] = obj.unified_job_template.get_absolute_url(self.context.get('request'))
|
||||||
|
if obj.unified_job_template.project:
|
||||||
|
res['project'] = obj.unified_job_template.project.get_absolute_url(self.context.get('request'))
|
||||||
|
if obj.inventory:
|
||||||
|
res['inventory'] = obj.inventory.get_absolute_url(self.context.get('request'))
|
||||||
|
elif obj.unified_job_template and obj.unified_job_template.inventory:
|
||||||
|
res['inventory'] = obj.unified_job_template.inventory.get_absolute_url(self.context.get('request'))
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def validate_unified_job_template(self, value):
|
def validate_unified_job_template(self, value):
|
||||||
|
Loading…
Reference in New Issue
Block a user