From da50bcdb96538361427038db750475fdb854712a Mon Sep 17 00:00:00 2001 From: boyska Date: Mon, 9 Jan 2017 16:56:59 +0100 Subject: [PATCH] FIX scripts suggestions cause crash on web edit The directory was assumed to be existing, which is wrong --- larigira/dbadmin/suggestions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/larigira/dbadmin/suggestions.py b/larigira/dbadmin/suggestions.py index f659442..31ea39e 100644 --- a/larigira/dbadmin/suggestions.py +++ b/larigira/dbadmin/suggestions.py @@ -41,6 +41,8 @@ def get_suggested_dirs(): def get_suggested_scripts(): base = get_conf()['SCRIPTS_PATH'] + if not base or not os.path.isdir(base): + return [] fnames = [f for f in os.listdir(base) if os.access(os.path.join(base, f), os.R_OK | os.X_OK)] return fnames