mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 01:21:21 +03:00
Merge pull request #1432 from AlanCoding/dragon_born_again
Fix server error with unicode in template
This commit is contained in:
commit
60e3dfe22c
@ -9,7 +9,7 @@ import six
|
|||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
from jinja2 import Environment, StrictUndefined
|
from jinja2 import Environment, StrictUndefined
|
||||||
from jinja2.exceptions import UndefinedError
|
from jinja2.exceptions import UndefinedError, TemplateSyntaxError
|
||||||
|
|
||||||
# Django
|
# Django
|
||||||
from django.core import exceptions as django_exceptions
|
from django.core import exceptions as django_exceptions
|
||||||
@ -810,6 +810,12 @@ class CredentialTypeInjectorField(JSONSchemaField):
|
|||||||
code='invalid',
|
code='invalid',
|
||||||
params={'value': value},
|
params={'value': value},
|
||||||
)
|
)
|
||||||
|
except TemplateSyntaxError as e:
|
||||||
|
raise django_exceptions.ValidationError(
|
||||||
|
_('Syntax error rendering template for %s inside of %s (%s)') % (key, type_, e),
|
||||||
|
code='invalid',
|
||||||
|
params={'value': value},
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class AskForField(models.BooleanField):
|
class AskForField(models.BooleanField):
|
||||||
|
Loading…
Reference in New Issue
Block a user