1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 01:21:21 +03:00

fix server error with unicode in template

This commit is contained in:
AlanCoding 2018-04-19 14:25:59 -04:00
parent 3798decafc
commit 9f6a4e135f
No known key found for this signature in database
GPG Key ID: FD2C3C012A72926B

View File

@ -9,7 +9,7 @@ import six
import urllib
from jinja2 import Environment, StrictUndefined
from jinja2.exceptions import UndefinedError
from jinja2.exceptions import UndefinedError, TemplateSyntaxError
# Django
from django.core import exceptions as django_exceptions
@ -810,6 +810,12 @@ class CredentialTypeInjectorField(JSONSchemaField):
code='invalid',
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):