added error message for undefined groups in the config
This commit is contained in:
parent
2bc5f6c28a
commit
9cbdf43812
@ -136,6 +136,11 @@ def read_config():
|
|||||||
app.open_in = "this_tab"
|
app.open_in = "this_tab"
|
||||||
|
|
||||||
if "groups" in config[section]:
|
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"]
|
app.groups = config[section]["groups"]
|
||||||
else:
|
else:
|
||||||
app.groups = None
|
app.groups = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user