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:
@@ -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"""
|
||||
|
||||
Reference in New Issue
Block a user