mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-06-03 10:50:20 +00:00
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 <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
729690792f
commit
2862862161
@ -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'
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user