lint: various non-semantic fixes
bumping fail-under for pylint to 9.72
This commit is contained in:
parent
7a54e4ea96
commit
f6452cb4fa
14 changed files with 47 additions and 29 deletions
|
@ -3,6 +3,7 @@ from typing import Any, Optional
|
|||
|
||||
import requests
|
||||
|
||||
from app.brm.brn import BRN
|
||||
from app.models import AbstractConfiguration
|
||||
from app.extensions import db
|
||||
|
||||
|
@ -49,6 +50,16 @@ class Webhook(AbstractConfiguration):
|
|||
format = db.Column(db.String(20))
|
||||
url = db.Column(db.String(255))
|
||||
|
||||
@property
|
||||
def brn(self) -> BRN:
|
||||
return BRN(
|
||||
group_id=0,
|
||||
product="notify",
|
||||
provider=self.format,
|
||||
resource_type="conf",
|
||||
resource_id=self.id
|
||||
)
|
||||
|
||||
def send(self, text: str) -> None:
|
||||
if self.format == "telegram":
|
||||
data = {"text": text}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue