兼容数据库为空的情况

This commit is contained in:
zayac 2024-03-30 16:15:29 +08:00
parent 77058f4859
commit 98bf0a4bf4

View File

@ -21,8 +21,9 @@ def load_registered_users():
"""
registered_users = set()
for user in get_all_users():
ids = user.telegram_ids.split(',')
registered_users.update(map(int, ids))
if user.telegram_ids:
ids = user.telegram_ids.split(',')
registered_users.update(map(int, ids))
return registered_users