From 063489c036f2c4f5da8cd6392e53b23381e2a7ba Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 7 Aug 2019 14:36:42 -0700 Subject: [PATCH] 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 Reviewed-by: James Valleroy --- plinth/frontpage.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plinth/frontpage.py b/plinth/frontpage.py index 72b3ffab7..1f448e3c4 100644 --- a/plinth/frontpage.py +++ b/plinth/frontpage.py @@ -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):