mirror of
https://github.com/koloideal/Quizzi.git
synced 2026-06-10 10:25:28 +03:00
commit
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
from datetime import datetime
|
||||
|
||||
from dishka import AsyncContainer
|
||||
|
||||
from trudex.infrastructure.database.dao.test import TestDAO
|
||||
from trudex.infrastructure.database.models import Test
|
||||
from trudex.infrastructure.utils.timezone import now_msk
|
||||
|
||||
|
||||
async def deactivate_expired_tests(container: AsyncContainer):
|
||||
@@ -13,5 +11,5 @@ async def deactivate_expired_tests(container: AsyncContainer):
|
||||
tests = await test_dao.get_all()
|
||||
|
||||
for test in tests:
|
||||
if test.expires_at and test.expires_at < datetime.utcnow() and test.is_active:
|
||||
if test.expires_at and test.expires_at < now_msk() and test.is_active:
|
||||
await test_dao.update(test.id, is_active=False)
|
||||
|
||||
Reference in New Issue
Block a user