From 47eb0f1efe073c1b3d7c932a6d4ad4789bec17a6 Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Mon, 24 May 2021 12:37:36 +0200 Subject: [PATCH] Rename local var display because shadows built-in --- orchestra/admin/utils.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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