forward db session dependency
This commit is contained in:
parent
148e6416c9
commit
094803cc8d
|
@ -173,7 +173,9 @@ def list_notification(idsonde: str):
|
|||
|
||||
|
||||
@app.get("/notifications/{idsonde}/text")
|
||||
def last_notif_text(request: Request, idsonde: str):
|
||||
def last_notif_text(request: Request, idsonde: str, db: Session = Depends(get_db)):
|
||||
db_sonde = crud.get_sonde(db, identifiant=idsonde)
|
||||
|
||||
notifs = notifications[idsonde]
|
||||
try:
|
||||
content = notifs[-1]
|
||||
|
@ -272,7 +274,7 @@ def post_sonde_data(
|
|||
)
|
||||
if content:
|
||||
Notifier(db, idsonde, content)
|
||||
res = last_notif_text(request, idsonde)
|
||||
res = last_notif_text(request, idsonde, db)
|
||||
html = res.body.decode("utf-8")
|
||||
from papi.mail_sendermodel import sendmail
|
||||
|
||||
|
|
Loading…
Reference in New Issue