From b0fe1ea8f214f8d0b74a966e7bef2ceeac54ccef Mon Sep 17 00:00:00 2001 From: mhbahmani Date: Wed, 1 Nov 2023 23:56:14 +0330 Subject: [PATCH] Convert users to list --- src/automatic_reserve_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/automatic_reserve_handler.py b/src/automatic_reserve_handler.py index c2d323d..e4c5eb9 100644 --- a/src/automatic_reserve_handler.py +++ b/src/automatic_reserve_handler.py @@ -58,9 +58,9 @@ async def automatic_reserve(self, context=None, user_id: str = None, admin_user_ else: bot = context.bot logging.info("########### Automatic reserve started ################") - users = [self.db.get_user_reserve_info(user_id)] if user_id else self.db.get_users_with_automatic_reserve() + users = [self.db.get_user_reserve_info(user_id)] if user_id else list(self.db.get_users_with_automatic_reserve()) logging.info(f"**** Number of users: {len(users)} ****") - for user in list(users): + for user in users: msg_receiver_id = admin_user_id if admin_user_id else user['user_id'] reserves = {} try: