mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 07:26:03 -03:30
Merge pull request #514 from AlanCoding/no_ordereddit
[3.2.2] prevent OrderedDict syntax in error message
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
# Python
|
# Python
|
||||||
import logging
|
import logging
|
||||||
import urlparse
|
import urlparse
|
||||||
|
from collections import OrderedDict
|
||||||
|
|
||||||
# Django
|
# Django
|
||||||
from django.core.validators import URLValidator
|
from django.core.validators import URLValidator
|
||||||
@@ -98,5 +99,7 @@ class KeyValueField(DictField):
|
|||||||
ret = super(KeyValueField, self).to_internal_value(data)
|
ret = super(KeyValueField, self).to_internal_value(data)
|
||||||
for value in data.values():
|
for value in data.values():
|
||||||
if not isinstance(value, six.string_types + six.integer_types + (float,)):
|
if not isinstance(value, six.string_types + six.integer_types + (float,)):
|
||||||
|
if isinstance(value, OrderedDict):
|
||||||
|
value = dict(value)
|
||||||
self.fail('invalid_child', input=value)
|
self.fail('invalid_child', input=value)
|
||||||
return ret
|
return ret
|
||||||
|
|||||||
Reference in New Issue
Block a user