mirror of
https://github.com/ansible/awx.git
synced 2026-02-02 01:58:09 -03:30
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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user