diff --git a/app/modules/alerting/alerting.py b/app/modules/alerting/alerting.py index c12e37ce..00d42243 100644 --- a/app/modules/alerting/alerting.py +++ b/app/modules/alerting/alerting.py @@ -3,6 +3,7 @@ import json import http.cookies import pika +from jinja2 import Environment, FileSystemLoader import modules.db.sql as sql import modules.roxywi.common as roxywi_common @@ -214,6 +215,9 @@ def check_email_alert() -> None: print(f'error: Cannot send a message {e}') +error_mess = 'error: All fields must be completed' + + def add_telegram_channel(token: str, channel: str, group: str, page: str) -> None: if token is None or channel is None or group is None: print(error_mess) diff --git a/app/options.py b/app/options.py index e83e80e8..56f8fcdc 100644 --- a/app/options.py +++ b/app/options.py @@ -1777,7 +1777,7 @@ if form.getvalue('ssh_cert'): roxywi_common.logging("Roxy-WI server", f"A new SSH cert has been uploaded {ssh_keys}", roxywi=1, login=1) if form.getvalue('newtelegram'): - import modules.alerting.alerting as alertin + import modules.alerting.alerting as alerting token = common.checkAjaxInput(form.getvalue('newtelegram')) channel = common.checkAjaxInput(form.getvalue('chanel')) @@ -1810,7 +1810,7 @@ if form.getvalue('slackdel') is not None: import modules.alerting.alerting as alerting channel_id = common.checkAjaxInput(form.getvalue('slackdel')) - slack = sql.select_slack(id=slackdel) + slack = sql.select_slack(id=channel_id) alerting.delete_slack_channel(telegram, channel_id)