Make ValidationError consistent with rest-framework

This is silly, but rest-framework returns an error with a '.' at the
end.  Test automation validates the error responses. Rather than special
case this condition, I've chosen to raise an Exception with a msg
consistent with rest-framework.
This commit is contained in:
James Laska
2015-03-13 08:52:23 -04:00
parent aa55f96316
commit 6258035ca8

View File

@@ -1308,7 +1308,7 @@ class JobOptionsSerializer(BaseSerializer):
def validate_project(self, attrs, source):
project = attrs.get('project', None)
if not project and attrs.get('job_type') != PERM_INVENTORY_SCAN:
raise serializers.ValidationError("This field is required")
raise serializers.ValidationError("This field is required.")
return attrs
def validate_playbook(self, attrs, source):