mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 09:51:09 +03:00
prevent server error with CT unicode keys
This commit is contained in:
parent
1fc6a34e62
commit
f78037c0f3
@ -405,7 +405,7 @@ class JSONSchemaField(JSONBField):
|
|||||||
error.message = re.sub(r'\bu(\'|")', r'\1', error.message)
|
error.message = re.sub(r'\bu(\'|")', r'\1', error.message)
|
||||||
|
|
||||||
if error.validator == 'pattern' and 'error' in error.schema:
|
if error.validator == 'pattern' and 'error' in error.schema:
|
||||||
error.message = error.schema['error'].format(instance=error.instance)
|
error.message = six.text_type(error.schema['error']).format(instance=error.instance)
|
||||||
elif error.validator == 'type':
|
elif error.validator == 'type':
|
||||||
expected_type = error.validator_value
|
expected_type = error.validator_value
|
||||||
if expected_type == 'object':
|
if expected_type == 'object':
|
||||||
@ -551,7 +551,7 @@ class CredentialInputField(JSONSchemaField):
|
|||||||
format_checker=self.format_checker
|
format_checker=self.format_checker
|
||||||
).iter_errors(decrypted_values):
|
).iter_errors(decrypted_values):
|
||||||
if error.validator == 'pattern' and 'error' in error.schema:
|
if error.validator == 'pattern' and 'error' in error.schema:
|
||||||
error.message = error.schema['error'].format(instance=error.instance)
|
error.message = six.text_type(error.schema['error']).format(instance=error.instance)
|
||||||
if error.validator == 'dependencies':
|
if error.validator == 'dependencies':
|
||||||
# replace the default error messaging w/ a better i18n string
|
# replace the default error messaging w/ a better i18n string
|
||||||
# I wish there was a better way to determine the parameters of
|
# I wish there was a better way to determine the parameters of
|
||||||
|
Loading…
Reference in New Issue
Block a user