mirror of
https://github.com/ansible/awx.git
synced 2026-04-09 12:09:20 -02:30
Fix bug with missing parent field and diff with parent
Remove corresponding views for job instance_groups Validate job_slice_count in API Remove defaults from some job launch view prompts the null default is preferable
This commit is contained in:
@@ -3068,7 +3068,6 @@ class JobSerializer(UnifiedJobSerializer, JobOptionsSerializer):
|
||||
res['project_update'] = self.reverse('api:project_update_detail', kwargs={'pk': obj.project_update.pk})
|
||||
except ObjectDoesNotExist:
|
||||
pass
|
||||
res['instance_groups'] = self.reverse('api:job_instance_group_list', kwargs={'pk': obj.pk})
|
||||
res['relaunch'] = self.reverse('api:job_relaunch', kwargs={'pk': obj.pk})
|
||||
return res
|
||||
|
||||
@@ -4141,9 +4140,9 @@ class JobLaunchSerializer(BaseSerializer):
|
||||
verbosity = serializers.ChoiceField(required=False, choices=VERBOSITY_CHOICES, write_only=True)
|
||||
execution_environment = serializers.PrimaryKeyRelatedField(queryset=ExecutionEnvironment.objects.all(), required=False, write_only=True)
|
||||
labels = serializers.PrimaryKeyRelatedField(many=True, queryset=Label.objects.all(), required=False, write_only=True)
|
||||
forks = serializers.IntegerField(required=False, write_only=True, min_value=0, default=1)
|
||||
job_slice_count = serializers.IntegerField(required=False, write_only=True, min_value=0, default=0)
|
||||
timeout = serializers.IntegerField(required=False, write_only=True, default=0)
|
||||
forks = serializers.IntegerField(required=False, write_only=True, min_value=0)
|
||||
job_slice_count = serializers.IntegerField(required=False, write_only=True, min_value=0)
|
||||
timeout = serializers.IntegerField(required=False, write_only=True)
|
||||
instance_groups = serializers.PrimaryKeyRelatedField(many=True, queryset=InstanceGroup.objects.all(), required=False, write_only=True)
|
||||
|
||||
class Meta:
|
||||
|
||||
@@ -16,7 +16,6 @@ from awx.api.views import (
|
||||
JobStdout,
|
||||
JobNotificationsList,
|
||||
JobLabelList,
|
||||
JobInstanceGroupList,
|
||||
JobHostSummaryDetail,
|
||||
)
|
||||
|
||||
@@ -34,7 +33,6 @@ urls = [
|
||||
re_path(r'^(?P<pk>[0-9]+)/stdout/$', JobStdout.as_view(), name='job_stdout'),
|
||||
re_path(r'^(?P<pk>[0-9]+)/notifications/$', JobNotificationsList.as_view(), name='job_notifications_list'),
|
||||
re_path(r'^(?P<pk>[0-9]+)/labels/$', JobLabelList.as_view(), name='job_label_list'),
|
||||
re_path(r'^(?P<pk>[0-9]+)/instance_groups/$', JobInstanceGroupList.as_view(), name='job_instance_group_list'),
|
||||
re_path(r'^(?P<pk>[0-9]+)/$', JobHostSummaryDetail.as_view(), name='job_host_summary_detail'),
|
||||
]
|
||||
|
||||
|
||||
@@ -3568,15 +3568,6 @@ class JobLabelList(SubListAPIView):
|
||||
parent_key = 'job'
|
||||
|
||||
|
||||
class JobInstanceGroupList(SubListAPIView):
|
||||
|
||||
model = models.InstanceGroup
|
||||
serializer_class = serializers.InstanceGroupSerializer
|
||||
parent_model = models.Job
|
||||
relationship = 'instance_groups'
|
||||
parent_key = 'job'
|
||||
|
||||
|
||||
class WorkflowJobLabelList(JobLabelList):
|
||||
parent_model = models.WorkflowJob
|
||||
|
||||
|
||||
Reference in New Issue
Block a user