notify and fetch

This commit is contained in:
Administrator 2022-10-21 15:16:21 +03:00
parent 2eadeaaabc
commit 66bb604b48
2 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ def fetch_schedule_for_user(user_hse_id: int):
def process(): def process():
for user in mongo.users_collection.find({}): for user in mongo.users_collection.find({"hse_id": {"$ne": None}}):
fetch_schedule_for_user(user['hse_id']) fetch_schedule_for_user(user['hse_id'])

View File

@ -7,7 +7,7 @@ from helpers.mongo import mongo
def process(): def process():
for user in mongo.users_collection.find({"notify_minutes": {"$ne": None}}): for user in mongo.users_collection.find({"notify_minutes": {"$ne": None}, "hse_id": {"$ne": None}}):
zone = zoneinfo.ZoneInfo("Europe/Moscow") zone = zoneinfo.ZoneInfo("Europe/Moscow")
now = datetime.datetime.now(zone) now = datetime.datetime.now(zone)
for lesson in mongo.lessons_collection.find({ for lesson in mongo.lessons_collection.find({