From 124405a8294f688a5b64e0ebecc151fc9589c960 Mon Sep 17 00:00:00 2001 From: itqop Date: Mon, 15 Apr 2024 14:37:04 +0300 Subject: [PATCH] fix --- app/handlers.py | 1 - db/database.py | 2 ++ main.py | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/handlers.py b/app/handlers.py index d004133..e189e5f 100644 --- a/app/handlers.py +++ b/app/handlers.py @@ -76,5 +76,4 @@ async def get_profile(schema: RequestSchema) -> UserSchema: has_sub=has_sub, tab=schema.tab ) - print(profile) return profile \ No newline at end of file diff --git a/db/database.py b/db/database.py index caa2647..e4bd2c3 100644 --- a/db/database.py +++ b/db/database.py @@ -141,6 +141,8 @@ class Database: async def update_subscription(self, user: UserSchema): async with self.AsyncSessionLocal() as session: try: + await self.delete_expired_subscriptions() + await self.delete_expired_tab_users() expiry_datetime = datetime.datetime.fromtimestamp(user.expiry, datetime.timezone.utc) if user.has_sub: subscription = await session.execute(select(Subscribe).where(Subscribe.discord == user.discord_id and Subscribe.nickname == user.username)) diff --git a/main.py b/main.py index 22ac35a..98906f4 100644 --- a/main.py +++ b/main.py @@ -1,2 +1,3 @@ if __name__ == 'main': - from app import app, database \ No newline at end of file + from app import app, database + \ No newline at end of file