Use a with block rather than set to avoid leaking variables

This commit is contained in:
Gregoo 2025-01-31 11:05:19 +01:00
parent 4278e088a4
commit 73fa71e380

View File

@ -19,7 +19,7 @@
</thead>
<tbody>
{% for item in table_collection %}
{% set retirement_date = retired.get(item.fields.set) %}
{% with retirement_date = retired.get(item.fields.set) %}
<tr>
{{ table.image(item.url_for_image(), caption=item.fields.name, alt=item.fields.set) }}
<td>{{ item.fields.set }} {{ table.rebrickable(item) }}</td>
@ -36,6 +36,7 @@
</td>
{% endif %}
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>