diff --git a/orchestra/admin/utils.py b/orchestra/admin/utils.py
index 764edf84..e38ceb72 100644
--- a/orchestra/admin/utils.py
+++ b/orchestra/admin/utils.py
@@ -113,21 +113,21 @@ def admin_link(*args, **kwargs):
return '---'
if not getattr(obj, 'pk', None):
return '---'
- display = kwargs.get('display')
- if display:
- display = getattr(obj, display, display)
+ display_ = kwargs.get('display')
+ if display_:
+ display_ = getattr(obj, display_, display_)
else:
- display = obj
+ display_ = obj
try:
url = change_url(obj)
except NoReverseMatch:
# Does not has admin
- return str(display)
+ return str(display_)
extra = ''
if kwargs['popup']:
- extra = 'onclick="return showAddAnotherPopup(this);"'
+ extra = mark_safe('onclick="return showAddAnotherPopup(this);"')
title = "Change %s" % obj._meta.verbose_name
- return mark_safe('%s' % (url, title, extra, display))
+ return format_html('{}', url, title, extra, display_)
@admin_field