mirror of
https://github.com/ansible/awx.git
synced 2026-03-24 04:15:02 -02:30
Merge pull request #1665 from AlanCoding/job_ask_fields
Fix display of prompt-ability in job data
This commit is contained in:
@@ -1753,12 +1753,13 @@ class JobSerializer(UnifiedJobSerializer, JobOptionsSerializer):
|
|||||||
ask_tags_on_launch = serializers.ReadOnlyField()
|
ask_tags_on_launch = serializers.ReadOnlyField()
|
||||||
ask_job_type_on_launch = serializers.ReadOnlyField()
|
ask_job_type_on_launch = serializers.ReadOnlyField()
|
||||||
ask_inventory_on_launch = serializers.ReadOnlyField()
|
ask_inventory_on_launch = serializers.ReadOnlyField()
|
||||||
|
ask_credential_on_launch = serializers.ReadOnlyField()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Job
|
model = Job
|
||||||
fields = ('*', 'job_template', 'passwords_needed_to_start', 'ask_variables_on_launch',
|
fields = ('*', 'job_template', 'passwords_needed_to_start', 'ask_variables_on_launch',
|
||||||
'ask_limit_on_launch', 'ask_tags_on_launch', 'ask_job_type_on_launch',
|
'ask_limit_on_launch', 'ask_tags_on_launch', 'ask_job_type_on_launch',
|
||||||
'ask_inventory_on_launch')
|
'ask_inventory_on_launch', 'ask_credential_on_launch')
|
||||||
|
|
||||||
def get_related(self, obj):
|
def get_related(self, obj):
|
||||||
res = super(JobSerializer, self).get_related(obj)
|
res = super(JobSerializer, self).get_related(obj)
|
||||||
|
|||||||
@@ -510,6 +510,36 @@ class Job(UnifiedJob, JobOptions):
|
|||||||
return self.job_template.ask_variables_on_launch
|
return self.job_template.ask_variables_on_launch
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@property
|
||||||
|
def ask_limit_on_launch(self):
|
||||||
|
if self.job_template is not None:
|
||||||
|
return self.job_template.ask_limit_on_launch
|
||||||
|
return False
|
||||||
|
|
||||||
|
@property
|
||||||
|
def ask_tags_on_launch(self):
|
||||||
|
if self.job_template is not None:
|
||||||
|
return self.job_template.ask_tags_on_launch
|
||||||
|
return False
|
||||||
|
|
||||||
|
@property
|
||||||
|
def ask_job_type_on_launch(self):
|
||||||
|
if self.job_template is not None:
|
||||||
|
return self.job_template.ask_job_type_on_launch
|
||||||
|
return False
|
||||||
|
|
||||||
|
@property
|
||||||
|
def ask_inventory_on_launch(self):
|
||||||
|
if self.job_template is not None:
|
||||||
|
return self.job_template.ask_inventory_on_launch
|
||||||
|
return False
|
||||||
|
|
||||||
|
@property
|
||||||
|
def ask_credential_on_launch(self):
|
||||||
|
if self.job_template is not None:
|
||||||
|
return self.job_template.ask_credential_on_launch
|
||||||
|
return False
|
||||||
|
|
||||||
def get_passwords_needed_to_start(self):
|
def get_passwords_needed_to_start(self):
|
||||||
return self.passwords_needed_to_start
|
return self.passwords_needed_to_start
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user