Skip to content

Commit

Permalink
Merge pull request ansible#9890 from ryanpetrello/schedule-invalid-ujt
Browse files Browse the repository at this point in the history
allow schedules to be disabled even if the associated UJT isn't valid

see: ansible#8641

Reviewed-by: Christian Adams <[email protected]>
Reviewed-by: Jeff Bradberry <None>
  • Loading branch information
softwarefactory-project-zuul[bot] authored Apr 13, 2021
2 parents cd372e4 + b5f77bf commit b823181
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions awx/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4813,6 +4813,14 @@ def validate_unified_job_template(self, 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):

Expand Down

0 comments on commit b823181

Please sign in to comment.