Fix rendering of is_defined example. (#21575)

This commit is contained in:
Danny Tsang 2022-02-18 22:54:30 +00:00 committed by GitHub
parent f2119f6a05
commit 127c7707ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -515,10 +515,14 @@ The `is_defined` filter allows to throw an error if a value or object is not def
Example using `is_defined` to parse a JSON payload:
{% raw %}
```text
{{ value_json.val | is_defined }}
```
{% endraw %}
This will throw an error `UndefinedError: 'value_json' is undefined` if the JSON payload has no `val` attribute.