(20250124) Handling absence of'rs0' in reminders for work (cron).

This commit is contained in:
2025-01-24 10:33:29 +05:30
parent 6b7407ced2
commit c9c2a799de
+14 -11
View File
@@ -307,17 +307,20 @@ async def get_reminders_to_send() -> pd.DataFrame | None:
# Create the response DataFrame: # Create the response DataFrame:
if db_status == 1 and not exception: if db_status == 1 and not exception:
reminders_df = pd.DataFrame(db_json["data"]["rs0"]) reminders_json = db_json["data"].get("rs0", [])
reminders_df.rename( if reminders_json:
columns = { reminders_df = pd.DataFrame()
"token_id": "tokenKey", reminders_df.rename(
"recepient": "to", columns = {
"integration_type": "serviceType", "token_id": "tokenKey",
"provider": "client", "recepient": "to",
"message": "content" "integration_type": "serviceType",
}, "provider": "client",
inplace = True "message": "content"
) },
inplace = True
)
else: no_context_printer("No reminder(s)")
# If something goes wrong: # If something goes wrong:
except Exception as e: except Exception as e: