(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:
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: