add credential to job ask_ properties

This commit is contained in:
AlanCoding 2016-04-22 15:04:16 -04:00
parent 6958fb457a
commit 5e05859c20
2 changed files with 8 additions and 1 deletions

View File

@ -1733,12 +1733,13 @@ class JobSerializer(UnifiedJobSerializer, JobOptionsSerializer):
ask_tags_on_launch = serializers.ReadOnlyField()
ask_job_type_on_launch = serializers.ReadOnlyField()
ask_inventory_on_launch = serializers.ReadOnlyField()
ask_credential_on_launch = serializers.ReadOnlyField()
class Meta:
model = Job
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_inventory_on_launch')
'ask_inventory_on_launch', 'ask_credential_on_launch')
def get_related(self, obj):
res = super(JobSerializer, self).get_related(obj)

View File

@ -547,6 +547,12 @@ class Job(UnifiedJob, JobOptions):
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):
return self.passwords_needed_to_start