This commit is contained in:
itqop 2024-04-15 14:37:04 +03:00
parent 2c02ce1048
commit 124405a829
3 changed files with 4 additions and 2 deletions

View File

@ -76,5 +76,4 @@ async def get_profile(schema: RequestSchema) -> UserSchema:
has_sub=has_sub,
tab=schema.tab
)
print(profile)
return profile

View File

@ -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))

View File

@ -1,2 +1,3 @@
if __name__ == 'main':
from app import app, database
from app import app, database