mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-05 16:01:50 -05:00
Update relaunch endpoints to use custom serializer, check passwords needed before creating/copying job or ad hoc command.
This commit is contained in:
@@ -1481,6 +1481,18 @@ class JobCancelSerializer(JobSerializer):
|
||||
fields = ('can_cancel',)
|
||||
|
||||
|
||||
class JobRelaunchSerializer(JobSerializer):
|
||||
|
||||
class Meta:
|
||||
fields = ()
|
||||
|
||||
def to_native(self, obj):
|
||||
if obj:
|
||||
return dict([(p, u'') for p in obj.passwords_needed_to_start])
|
||||
else:
|
||||
return {}
|
||||
|
||||
|
||||
class AdHocCommandSerializer(UnifiedJobSerializer):
|
||||
|
||||
name = serializers.CharField(source='name', read_only=True)
|
||||
@@ -1533,6 +1545,18 @@ class AdHocCommandCancelSerializer(AdHocCommandSerializer):
|
||||
fields = ('can_cancel',)
|
||||
|
||||
|
||||
class AdHocCommandRelaunchSerializer(AdHocCommandSerializer):
|
||||
|
||||
class Meta:
|
||||
fields = ()
|
||||
|
||||
def to_native(self, obj):
|
||||
if obj:
|
||||
return dict([(p, u'') for p in obj.passwords_needed_to_start])
|
||||
else:
|
||||
return {}
|
||||
|
||||
|
||||
class SystemJobTemplateSerializer(UnifiedJobTemplateSerializer):
|
||||
|
||||
class Meta:
|
||||
|
||||
Reference in New Issue
Block a user