(20250124) Handling absence of'rs0' in reminders for work (cron).
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user