diff --git a/cron/misc/reminders_for_work.py b/cron/misc/reminders_for_work.py index f4fbbb8..9a88a08 100644 --- a/cron/misc/reminders_for_work.py +++ b/cron/misc/reminders_for_work.py @@ -307,17 +307,20 @@ async def get_reminders_to_send() -> pd.DataFrame | None: # Create the response DataFrame: if db_status == 1 and not exception: - reminders_df = pd.DataFrame(db_json["data"]["rs0"]) - reminders_df.rename( - columns = { - "token_id": "tokenKey", - "recepient": "to", - "integration_type": "serviceType", - "provider": "client", - "message": "content" - }, - inplace = True - ) + reminders_json = db_json["data"].get("rs0", []) + if reminders_json: + reminders_df = pd.DataFrame() + reminders_df.rename( + columns = { + "token_id": "tokenKey", + "recepient": "to", + "integration_type": "serviceType", + "provider": "client", + "message": "content" + }, + inplace = True + ) + else: no_context_printer("No reminder(s)") # If something goes wrong: except Exception as e: