From b09e9c0781fdbec08e76c08beb5f50ff4c767863 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 16 Feb 2021 17:16:36 +1100 Subject: [PATCH] Fixes for URL generation --- InvenTree/report/templatetags/report.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/InvenTree/report/templatetags/report.py b/InvenTree/report/templatetags/report.py index 67c3a48cb4..ad4a37972c 100644 --- a/InvenTree/report/templatetags/report.py +++ b/InvenTree/report/templatetags/report.py @@ -74,9 +74,12 @@ def internal_link(link, text): if not base_url: return text - url = f"{base_url}/{link}/" + if not base_url.endswith('/'): + base_url += '/' - # Remove any double quotes - url = url.replace("//", "/") + if base_url.endswith('/') and link.startswith('/'): + link = link[1:] + + url = f"{base_url}{link}" return mark_safe(f'{text}')