Admin interface for Referenzen fixed
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Has been cancelled

This commit is contained in:
2026-02-09 08:37:47 +01:00
parent 27e78d6f39
commit 633ecabdb9
3 changed files with 10 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
from django.contrib import admin
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from nested_admin import NestedStackedInline, NestedModelAdmin, NestedTabularInline
from .models import *
@@ -34,7 +34,7 @@ class ReferenzAdmin(NestedModelAdmin):
vorgaben_list = list(vorgaben) # Evaluate queryset once
count = len(vorgaben_list)
if count == 0:
return format_html("<em>Keine Vorgaben gefunden</em><p><strong>Gesamt: 0 Vorgaben</strong></p>")
return mark_safe("<em>Keine Vorgaben gefunden</em><p><strong>Gesamt: 0 Vorgaben</strong></p>")
html = "<div style='max-height: 300px; overflow-y: auto;'>"
html += "<table style='width: 100%; border-collapse: collapse;'>"
@@ -55,7 +55,7 @@ class ReferenzAdmin(NestedModelAdmin):
html += "</tbody></table>"
html += f"</div><p><strong>Gesamt: {count} Vorgabe{'n' if count != 1 else ''}</strong></p>"
return format_html(html)
return mark_safe(html)
vorgaben_list.short_description = "Zugeordnete Vorgaben"