diff --git a/jdav_web/material/models.py b/jdav_web/material/models.py
index b545a9a..3cac241 100644
--- a/jdav_web/material/models.py
+++ b/jdav_web/material/models.py
@@ -2,6 +2,7 @@ from datetime import datetime
from django.db import models
from django.utils import timezone
+from django.utils.html import format_html
from django.utils.translation import gettext_lazy as _
# maximum time in years of a material part until being replaced
@@ -50,18 +51,16 @@ class MaterialPart(models.Model):
def admin_thumbnail(self):
if self.photo:
- return ''.format(self.photo.url)
+ return format_html('
'.format(self.photo.url))
else:
- return 'kein Bild'
+ return format_html('kein Bild')
admin_thumbnail.short_description = _('Thumbnail')
- admin_thumbnail.allow_tags = True
def ownership_overview(self):
summary = ''
for owner in self.ownership_set.all():
summary += '
{}: {}
'.format(str(owner.owner), owner.count) - return summary - ownership_overview.allow_tags = True + return format_html(summary) ownership_overview.short_description = _('Owners') def not_too_old(self):