1
0
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:
Alan Rominger 2018-04-19 14:49:11 -04:00 committed by GitHub
commit 60e3dfe22c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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):