mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 07:26:03 -03:30
allow schedules to be disabled even if the UJT isn't valid
see: https://github.com/ansible/awx/issues/8641
This commit is contained in:
@@ -4805,6 +4805,14 @@ class ScheduleSerializer(LaunchConfigurationBaseSerializer, SchedulePreviewSeria
|
|||||||
)
|
)
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
def validate(self, attrs):
|
||||||
|
# if the schedule is being disabled, there's no need
|
||||||
|
# validate the related UnifiedJobTemplate
|
||||||
|
# see: https://github.com/ansible/awx/issues/8641
|
||||||
|
if self.context['request'].method == 'PATCH' and attrs == {'enabled': False}:
|
||||||
|
return attrs
|
||||||
|
return super(ScheduleSerializer, self).validate(attrs)
|
||||||
|
|
||||||
|
|
||||||
class InstanceSerializer(BaseSerializer):
|
class InstanceSerializer(BaseSerializer):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user