1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 01:21:21 +03:00

Make sure we notify vars_update_on_launch from job details

This commit is contained in:
Matthew Jones 2014-05-12 13:11:43 -04:00
parent 5e484b2503
commit 22984f91cc
3 changed files with 7 additions and 1 deletions

View File

@ -1233,10 +1233,11 @@ class JobTemplateSerializer(UnifiedJobTemplateSerializer, JobOptionsSerializer):
class JobSerializer(UnifiedJobSerializer, JobOptionsSerializer):
passwords_needed_to_start = serializers.Field(source='passwords_needed_to_start')
vars_prompt_on_launch = serializers.Field(source='vars_prompt_on_launch')
class Meta:
model = Job
fields = ('*', 'job_template', 'passwords_needed_to_start')
fields = ('*', 'job_template', 'passwords_needed_to_start', 'vars_prompt_on_launch')
def get_related(self, obj):
res = super(JobSerializer, self).get_related(obj)

View File

@ -1301,6 +1301,7 @@ class JobStart(GenericAPIView):
)
if obj.can_start:
data['passwords_needed_to_start'] = obj.passwords_needed_to_start
data['vars_prompt_on_launch'] = obj.vars_prompt_on_launch
return Response(data)
def post(self, request, *args, **kwargs):

View File

@ -230,6 +230,10 @@ class Job(UnifiedJob, JobOptions):
h = hmac.new(settings.SECRET_KEY, self.created.isoformat())
return '%d-%s' % (self.pk, h.hexdigest())
@property
def vars_prompt_on_launch(self):
return self.job_template.vars_prompt_on_launch
@property
def passwords_needed_to_start(self):
'''Return list of password field names needed to start the job.'''