api: Fix regression with listing only enabled apps in mobile app

Closes: #1626

Tests:

- List apps in mobile app front page. Observe that all apps are shown including
  disabled apps.

- With the patch, observer that only enabled apps are shown.

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-12 15:00:17 -07:00 committed by James Valleroy
parent 173d3464b0
commit 03dcaa57da
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -54,7 +54,7 @@ def get_shortcuts_as_json(username=None):
shortcuts = [
_get_shortcut_data(shortcut)
for shortcut in frontpage.Shortcut.list(username)
if shortcut.component_id
if shortcut.component_id and shortcut.is_enabled()
]
custom_shortcuts = frontpage.get_custom_shortcuts()
if custom_shortcuts: