cosmetic fix

This commit is contained in:
Colin Goutte 2021-10-06 16:38:26 +02:00
parent e2f11a52e2
commit d4d050372e
1 changed files with 5 additions and 5 deletions

View File

@ -65,7 +65,6 @@ class Notifier:
"status": ["Le monitoring est inacessible"],
}
)
breakpoint()
Notifier = Notifier()
@ -108,11 +107,11 @@ def list_notification(idsonde: str):
@app.get("/notifications/{idsonde}/text")
def list_notification_as_text(request: Request, idsonde: str):
notifs = notifications[idsonde]
notifs = notifications[idsonde]
try:
content =notifs[-1]
content = notifs[-1]
except IndexError:
return
return
try:
recipients = sondeid2notifsemails(idsonde)
except KeyError:
@ -232,9 +231,10 @@ def list_notification_as_text(
if message.endswith(k):
return "color: %s;" % v
return ""
if not (sonde := crud.get_sonde(db, idsonde)):
return
mesures = [x for x in crud.get_mesure(db, sonde.sonde_id, only_last=100)]
mesures = [x for x in crud.get_mesure(db, sonde.sonde_id, only_last=100)]
res = []