mirror of
https://github.com/ansible/awx.git
synced 2026-03-08 21:19:26 -02:30
fix server error with unicode in template
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user