Skip to content

Commit

Permalink
merge check complete
Browse files Browse the repository at this point in the history
  • Loading branch information
ikhit committed Oct 16, 2024
1 parent 1209e69 commit a480eeb
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 55 deletions.
4 changes: 2 additions & 2 deletions app/bot/fsm_contexts/feedback_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from helpers import ask_next_question, start_inactivity_timer, get_user_id
from loggers.log import setup_logging
from bot.validators import is_valid_rating
from crud.feedback import create_feedback
from crud.users import get_id_by_tg_id
from core.bot_setup import bot
from crud.feedback_crud import feedback_crud


router = Router()
Expand Down Expand Up @@ -81,7 +81,7 @@ async def process_description(

feedback_data = await state.get_data()

await create_feedback(feedback_data, session)
await feedback_crud.create(feedback_data, session)

logger.info(f'Запись создана в БД с ID: {feedback_data.get("user")}.')

Expand Down
17 changes: 0 additions & 17 deletions app/crud/feedback.py

This file was deleted.

10 changes: 0 additions & 10 deletions app/crud/feedback_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,5 @@ async def get_multi(self, session: AsyncSession):
)
return db_objs.scalars().all()

async def bulk_create(
self,
objs_in: list,
session: AsyncSession,
):
db_objs = [self.model(**obj) for obj in objs_in]
session.add_all(db_objs)
await session.commit()
return db_objs


feedback_crud = FeedbackCRUD(Feedback)
8 changes: 5 additions & 3 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@ async def main() -> None:

dispatcher.include_router(fsm_context_router)
dispatcher.include_router(feedback_context)
dispatcher.include_router(message_router)
dispatcher.include_router(callback_router)
dispatcher.include_router(admin_router)
dispatcher.include_router(user_router)
dispatcher.include_router(message_router)
dispatcher.include_router(callback_router)

try:
logger.info("Запуск бота...")
dispatcher.update.middleware(DataBaseSession(session_pool=AsyncSessionLocal))
dispatcher.update.middleware(
DataBaseSession(session_pool=AsyncSessionLocal)
)
await add_portfolio()
await set_admin()
await dispatcher.start_polling(bot)
Expand Down
23 changes: 0 additions & 23 deletions app/test.py

This file was deleted.

0 comments on commit a480eeb

Please sign in to comment.