1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 16:51:11 +03:00

Merge pull request #6817 from jangsutsr/6768_apply_validation_to_ctint_all_endpoint

Apply accumulated validation for CTinT all endpoint
This commit is contained in:
Aaron Tan 2017-06-30 15:39:19 -04:00 committed by GitHub
commit e3b7ec8997

View File

@ -70,6 +70,10 @@ class SettingSingletonSerializer(serializers.Serializer):
category_slug = self.context['view'].kwargs.get('category_slug', 'all')
except (KeyError, AttributeError):
category_slug = ''
if self.context['view'].kwargs.get('category_slug', '') == 'all':
for validate_func in settings_registry._validate_registry.values():
attrs = validate_func(self, attrs)
return attrs
custom_validate = settings_registry.get_registered_validate_func(category_slug)
return custom_validate(self, attrs) if custom_validate else attrs