From 9cbdf438129e7549f1333b1194444af545de0039 Mon Sep 17 00:00:00 2001 From: Ross Mountjoy Date: Sun, 9 Feb 2020 11:46:41 -0500 Subject: [PATCH] added error message for undefined groups in the config --- dashmachine/main/read_config.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dashmachine/main/read_config.py b/dashmachine/main/read_config.py index 040e145..6d9c4dd 100644 --- a/dashmachine/main/read_config.py +++ b/dashmachine/main/read_config.py @@ -136,6 +136,11 @@ def read_config(): app.open_in = "this_tab" if "groups" in config[section]: + for group_name in config[section]["groups"].split(","): + if not Groups.query.filter_by(name=group_name.strip()).first(): + return { + "msg": f"Invalid Config: {section} contains at group that is not defined." + } app.groups = config[section]["groups"] else: app.groups = None