portal: allow hiding automations
This commit is contained in:
parent
0008a24a0f
commit
cbd80cf7b3
1 changed files with 5 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from flask import render_template, flash, Response, Blueprint
|
from flask import render_template, flash, Response, Blueprint, current_app
|
||||||
from flask.typing import ResponseReturnValue
|
from flask.typing import ResponseReturnValue
|
||||||
from flask_wtf import FlaskForm
|
from flask_wtf import FlaskForm
|
||||||
from sqlalchemy import exc
|
from sqlalchemy import exc
|
||||||
|
@ -23,6 +23,10 @@ class EditAutomationForm(FlaskForm): # type: ignore
|
||||||
def automation_list() -> ResponseReturnValue:
|
def automation_list() -> ResponseReturnValue:
|
||||||
automations = Automation.query.filter(
|
automations = Automation.query.filter(
|
||||||
Automation.destroyed.is_(None)).order_by(Automation.description).all()
|
Automation.destroyed.is_(None)).order_by(Automation.description).all()
|
||||||
|
automations = list(filter(
|
||||||
|
lambda a: a.short_name not in current_app.config.get('HIDDEN_AUTOMATIONS', []),
|
||||||
|
automations
|
||||||
|
))
|
||||||
return render_template("list.html.j2",
|
return render_template("list.html.j2",
|
||||||
section="automation",
|
section="automation",
|
||||||
title="Automation Jobs",
|
title="Automation Jobs",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue