FIX scripts suggestions cause crash on web edit

The directory was assumed to be existing, which is wrong
This commit is contained in:
boyska 2017-01-09 16:56:59 +01:00
parent 3b49ae0679
commit da50bcdb96
No known key found for this signature in database
GPG key ID: 7395DCAE58289CA9

View file

@ -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