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:
parent
3798decafc
commit
9f6a4e135f
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user