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