From 619ec905b28e8bf5a0544dec15e72db396e78bac Mon Sep 17 00:00:00 2001 From: chris meyers Date: Tue, 24 Apr 2018 14:05:38 -0400 Subject: [PATCH] policy fields not required * They were previously not required until a min/max was enforced. This caused the fields to, unintentionally, be required. * This fix makes the policy fields not required and provides sane defaults. --- awx/api/serializers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/api/serializers.py b/awx/api/serializers.py index bba331fa23..99bdf339ea 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -4587,8 +4587,8 @@ class InstanceGroupSerializer(BaseSerializer): percent_capacity_remaining = serializers.SerializerMethodField() jobs_running = serializers.SerializerMethodField() instances = serializers.SerializerMethodField() - policy_instance_percentage = serializers.IntegerField(min_value=0, max_value=100) - policy_instance_minimum = serializers.IntegerField(min_value=0) + policy_instance_percentage = serializers.IntegerField(min_value=0, max_value=100, required=False, initial=0) + policy_instance_minimum = serializers.IntegerField(min_value=0, required=False, initial=0) class Meta: model = InstanceGroup