Skip to content

Commit b45f79d

Browse files
committed
minor #9603 Updated a Twig example (javiereguiluz)
This PR was merged into the 2.7 branch. Discussion ---------- Updated a Twig example After merging #9581 I realized that we could improve the example using modern Twig code. Commits ------- b1659f1 Updated a Twig example
2 parents 1ee194d + b1659f1 commit b45f79d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

validation/severity.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,7 @@ so that the severity is added as an additional HTML class:
155155
{%- if errors|length > 0 -%}
156156
<ul>
157157
{%- for error in errors -%}
158-
{% if error.constraint.payload.severity is defined %}
159-
{% set severity = error.constraint.payload.severity %}
160-
{% endif %}
161-
<li{% if severity is defined %} class="{{ severity }}"{% endif %}>{{ error.message }}</li>
158+
<li class="{{ error.constraint.payload.severity ?? '' }}">{{ error.message }}</li>
162159
{%- endfor -%}
163160
</ul>
164161
{%- endif -%}

0 commit comments

Comments
 (0)