mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 12:41:19 -03:30
fill in summary inv for sched only when needed
* If scheduler inv exists then the inv summary will be filled in with our generic summary filler inner. Else, if the related unified job has an inventory, fill in the inv summary with that, explicitly.
This commit is contained in:
parent
e3614c3012
commit
23e1feba96
@ -4616,10 +4616,11 @@ class ScheduleSerializer(LaunchConfigurationBaseSerializer, SchedulePreviewSeria
|
||||
|
||||
def get_summary_fields(self, obj):
|
||||
summary_fields = super(ScheduleSerializer, self).get_summary_fields(obj)
|
||||
if 'inventory' in summary_fields:
|
||||
return summary_fields
|
||||
|
||||
inventory = None
|
||||
if obj.inventory:
|
||||
inventory = obj.inventory
|
||||
elif obj.unified_job_template and getattr(obj.unified_job_template, 'inventory', None):
|
||||
if obj.unified_job_template and getattr(obj.unified_job_template, 'inventory', None):
|
||||
inventory = obj.unified_job_template.inventory
|
||||
else:
|
||||
return summary_fields
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user