docs: remove last occurrences to jinja2
This commit is contained in:
@ -21,8 +21,8 @@ A Prompt has the following attributes:
|
||||
|
||||
HTML name used for the prompt. This key is also used to later retrieve the data in expression policies:
|
||||
|
||||
```jinja2
|
||||
{{ request.context.prompt_data.<field_key> }}
|
||||
```python
|
||||
request.context.get('prompt_data').get('<field_key>')
|
||||
```
|
||||
|
||||
### `label`
|
||||
|
@ -4,13 +4,12 @@ Further validation of prompts can be done using policies.
|
||||
|
||||
To validate that two password fields are identical, create the following expression policy:
|
||||
|
||||
```jinja2
|
||||
{% if request.context.prompt_data.password == request.context.prompt_data.password_repeat %}
|
||||
True
|
||||
{% else %}
|
||||
{% do pb_message("Passwords don't match.") %}
|
||||
False
|
||||
{% endif %}
|
||||
```python
|
||||
if request.context.get('prompt_data').get('password') == request.context.get('prompt_data').get('password_repeat'):
|
||||
return True
|
||||
|
||||
pb_message("Passwords don't match.")
|
||||
return False
|
||||
```
|
||||
This policy expects you two have two password fields with `field_key` set to `password` and `password_repeat`.
|
||||
|
||||
|
Reference in New Issue
Block a user