From b3215596f12c0bd1b36c7bc32cb7221ad2c8495c Mon Sep 17 00:00:00 2001 From: DmitryGantimurov Date: Fri, 11 Aug 2023 15:06:05 +0300 Subject: [PATCH] Variables used in api/trashbox moved to service.py --- back/api.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/back/api.py b/back/api.py index a141288..b515fdb 100644 --- a/back/api.py +++ b/back/api.py @@ -22,9 +22,8 @@ import shutil import os from .db import Base, engine, SessionLocal, database, Session -from .service import add_poems_to_db, generate_poem, check_obsolete, get_query_results from .scheduler import app as app_rocketry -from . import schemas, models, utils +from . import schemas, models, utils, service Base.metadata.create_all(bind=engine) @@ -112,7 +111,7 @@ def delete_from_db(announcement: schemas.DelAnnouncement, db: Annotated[Session, # Забронировать объявление @app.post("/api/book") def change_book_status(data: schemas.Book, current_user: Annotated[schemas.User, Depends(utils.get_current_user)], - db: Annotated[Session, Depends(utils.get_db)], db: Annotated[Session, Depends(utils.get_db)]): + db: Annotated[Session, Depends(utils.get_db)]): # Находим объявление по данному id announcement_to_change = db.query(models.Announcement).filter(models.Announcement.id == data.id).first() # Проверяем, что объявление с данным id существует