frontpage: Fix regression with loading custom shortcuts

Closes: #1621

This causes the freedombox service to fail to start (and restart continuously)
when a custom shortcuts are provided using JSON file.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2019-08-11 07:46:06 -04:00
1 parent 639fd71d88
commit 063489c036
1 file changed
+6 -2
+6 -2
View File
@@ -146,8 +146,12 @@ def add_custom_shortcuts():
if not web_app_url:
continue
Shortcut(None, shortcut['name'], shortcut['short_description'],
icon=shortcut['icon_url'], url=web_app_url)
shortcut_id = shortcut.get('id', shortcut['name'])
component_id = 'shortcut-custom-' + shortcut_id
component = Shortcut(component_id, shortcut['name'],
shortcut['short_description'],
icon=shortcut['icon_url'], url=web_app_url)
component.set_enabled(True)
def _extract_web_app_url(custom_shortcut):