Admin interface for Referenzen fixed
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Has been cancelled
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Has been cancelled
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user