From d4d41fdc11cce0ecd7f7c8696185fcb983702297 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 25 Nov 2024 17:30:52 +0100 Subject: 🐛 tables: force "/" at the end of show item url MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/views_item.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'ishtar_common/views_item.py') diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index d4a975e37..8d41d1cc6 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -2881,9 +2881,10 @@ def get_item( if data_type.startswith("json"): rows = [] if data_type == "json-map": - lnk = link_template.format( - reverse("show-" + default_name, args=[999999, ""]), - ) + curl = reverse("show-" + default_name, args=[999999, ""]) + if not curl.endswith("/"): + curl += "/" + lnk = link_template.format(curl) lnk = lnk.replace("999999", "") if not has_locks: lnk = lnk.replace("", "") @@ -2895,10 +2896,11 @@ def get_item( } if not no_link: try: + curl = reverse("show-" + default_name, args=[data[0], ""]) + if not curl.endswith("/"): + curl += "/" lnk_template = link_template - lnk = lnk_template.format( - reverse("show-" + default_name, args=[data[0], ""]) - ) + lnk = lnk_template.format(curl) if has_locks and data[-2]: if data[-1] == current_user_id: lnk = lnk.replace("", own_lock) -- cgit v1.2.3