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 2019-08-07 14:36:42 -07:00 committed by James Valleroy
parent 639fd71d88
commit 063489c036
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

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):