Fix nachweis-board TemplateSyntaxError: add missing get_item filter

The nachweis_board.html template used a get_item filter that was never
defined. Added it to help_tags.py and loaded the tag library in the template.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
SysAdmin Agent
2026-03-11 13:20:23 +00:00
parent 2be72c3990
commit 905aa879ee
2 changed files with 12 additions and 1 deletions

View File

@@ -34,6 +34,17 @@ def help_box_exists(page_key):
return HelpBox.get_help_for_page(page_key) is not None return HelpBox.get_help_for_page(page_key) is not None
@register.filter
def get_item(dictionary, key):
"""Lookup a key in a dictionary, trying int conversion for numeric keys."""
if dictionary is None:
return None
result = dictionary.get(key)
if result is None and isinstance(key, str) and key.isdigit():
result = dictionary.get(int(key))
return result
@register.filter @register.filter
def markdown_to_html(text): def markdown_to_html(text):
"""Konvertiere Markdown-Text zu HTML""" """Konvertiere Markdown-Text zu HTML"""

View File

@@ -1,5 +1,5 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load static %} {% load static help_tags %}
{% block title %}Nachweis-Board Stiftungsverwaltung{% endblock %} {% block title %}Nachweis-Board Stiftungsverwaltung{% endblock %}