mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 04:26:44 +00:00
Fixes for URL generation
This commit is contained in:
parent
fdca3d842d
commit
b09e9c0781
@ -74,9 +74,12 @@ def internal_link(link, text):
|
|||||||
if not base_url:
|
if not base_url:
|
||||||
return text
|
return text
|
||||||
|
|
||||||
url = f"{base_url}/{link}/"
|
if not base_url.endswith('/'):
|
||||||
|
base_url += '/'
|
||||||
|
|
||||||
# Remove any double quotes
|
if base_url.endswith('/') and link.startswith('/'):
|
||||||
url = url.replace("//", "/")
|
link = link[1:]
|
||||||
|
|
||||||
|
url = f"{base_url}{link}"
|
||||||
|
|
||||||
return mark_safe(f'<a href="{url}">{text}</a>')
|
return mark_safe(f'<a href="{url}">{text}</a>')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user