From 2862862161db95c13918396b99de1b35b24b38e1 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 17 Sep 2025 16:27:06 -0700 Subject: [PATCH] api: Fix showing icons for custom shortcuts Tests: - Add a custom shortcut and provide a custom icon for it in /var/www/plinth/custom/static/icons/. Visit the page /plinth/api/1/shortcuts/. The icon path for the custom shortcut is correct and accessible from browser. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/api/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plinth/modules/api/views.py b/plinth/modules/api/views.py index 006859e80..ac3aff0fd 100644 --- a/plinth/modules/api/views.py +++ b/plinth/modules/api/views.py @@ -65,6 +65,9 @@ def _get_icon_url(app_id, icon_name): if not icon_name: return None + if icon_name.startswith('/'): + return icon_name + if app_id: return static(f'{app_id}') + f'/icons/{icon_name}.png'