From b33b44b526d030b7c7e4a7c05899229344aa5e3d Mon Sep 17 00:00:00 2001 From: Joseph Nuthalapati Date: Thu, 21 Feb 2019 19:47:15 +0530 Subject: [PATCH] config: Fix error when setting JSXC as the home page Signed-off-by: Joseph Nuthalapati Reviewed-by: James Valleroy --- plinth/modules/config/__init__.py | 6 ++++-- plinth/modules/config/views.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plinth/modules/config/__init__.py b/plinth/modules/config/__init__.py index 1b1264bcf..8b37e0499 100644 --- a/plinth/modules/config/__init__.py +++ b/plinth/modules/config/__init__.py @@ -79,8 +79,10 @@ def get_home_page(): # match this against the app_id in the entries of frontpage.get_shortcuts() # The underscore is to handle Ikiwiki app_ids app = app_path.strip('/"').replace('/', '_') - if app == "index.html": - return "apache-default" + if app == 'index.html': + return 'apache-default' + elif app.endswith('jsxc'): + return 'jsxc' else: return app diff --git a/plinth/modules/config/views.py b/plinth/modules/config/views.py index d53f28083..d15c6e8f1 100644 --- a/plinth/modules/config/views.py +++ b/plinth/modules/config/views.py @@ -116,7 +116,7 @@ def change_home_page(app_id): if shortcut['id'] == app_id ][0] - actions.superuser_run('config', ['set-home-page', url]) + actions.superuser_run('config', ['set-home-page', url.strip('/')]) def set_hostname(hostname):