From 905aa879ee9ce7b6db5b60faadaea001e99b034a Mon Sep 17 00:00:00 2001 From: SysAdmin Agent Date: Wed, 11 Mar 2026 13:20:23 +0000 Subject: [PATCH] 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 --- app/stiftung/templatetags/help_tags.py | 11 +++++++++++ app/templates/stiftung/nachweis_board.html | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/stiftung/templatetags/help_tags.py b/app/stiftung/templatetags/help_tags.py index 74661a3..83ef04a 100644 --- a/app/stiftung/templatetags/help_tags.py +++ b/app/stiftung/templatetags/help_tags.py @@ -34,6 +34,17 @@ def help_box_exists(page_key): 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 def markdown_to_html(text): """Konvertiere Markdown-Text zu HTML""" diff --git a/app/templates/stiftung/nachweis_board.html b/app/templates/stiftung/nachweis_board.html index 6de8cba..4ee5651 100644 --- a/app/templates/stiftung/nachweis_board.html +++ b/app/templates/stiftung/nachweis_board.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} -{% load static %} +{% load static help_tags %} {% block title %}Nachweis-Board – Stiftungsverwaltung{% endblock %}