diff --git a/daemons/fetch.py b/daemons/fetch.py index 846b6c3..838cd20 100644 --- a/daemons/fetch.py +++ b/daemons/fetch.py @@ -61,7 +61,7 @@ def fetch_schedule_for_user(user_hse_id: int): 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']) diff --git a/daemons/notify.py b/daemons/notify.py index c2f0196..948b167 100644 --- a/daemons/notify.py +++ b/daemons/notify.py @@ -7,7 +7,7 @@ from helpers.mongo import mongo 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") now = datetime.datetime.now(zone) for lesson in mongo.lessons_collection.find({