fixs
This commit is contained in:
parent
9cb00eec52
commit
8ef95ec7e8
|
@ -167,7 +167,7 @@ class Database:
|
|||
async def delete_expired_subscriptions(self):
|
||||
async with self.AsyncSessionLocal() as session:
|
||||
try:
|
||||
await session.execute(delete(Subscribe).where(Subscribe.expiry < datetime.now(datetime.timezone.utc)))
|
||||
await session.execute(delete(Subscribe).where(Subscribe.expiry < datetime.datetime.now(datetime.timezone.utc)))
|
||||
await session.commit()
|
||||
except Exception as e:
|
||||
print("Ошибка при удалении устаревших подписок:", e)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from pydantic import PositiveInt
|
||||
from .UUIDSchema import UUIDSchema
|
||||
from .TabSchema import TabSchema
|
||||
|
||||
|
||||
class UserSchema(UUIDSchema):
|
||||
|
@ -7,3 +8,4 @@ class UserSchema(UUIDSchema):
|
|||
discord_id: str
|
||||
has_sub: bool
|
||||
expiry: PositiveInt = 1
|
||||
tab: TabSchema = TabSchema()
|
Loading…
Reference in New Issue