From 126d59cfee8696143d1527361355e1d139911343 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Sun, 19 Jan 2025 17:53:09 +0530 Subject: [PATCH] fix: update password encryption keys in Auth table --- .../rename_twilio_settings_to_crm_twilio_settings.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crm/patches/v1_0/rename_twilio_settings_to_crm_twilio_settings.py b/crm/patches/v1_0/rename_twilio_settings_to_crm_twilio_settings.py index 8b38d770..34976484 100644 --- a/crm/patches/v1_0/rename_twilio_settings_to_crm_twilio_settings.py +++ b/crm/patches/v1_0/rename_twilio_settings_to_crm_twilio_settings.py @@ -9,3 +9,12 @@ def execute(): frappe.flags.ignore_route_conflict_validation = False frappe.reload_doctype("CRM Twilio Settings", force=True) + + if frappe.db.exists("__Auth", {"doctype": "Twilio Settings"}): + Auth = frappe.qb.DocType("__Auth") + result = frappe.qb.from_(Auth).select("*").where(Auth.doctype == "Twilio Settings").run(as_dict=True) + + for row in result: + frappe.qb.into(Auth).insert( + "CRM Twilio Settings", "CRM Twilio Settings", row.fieldname, row.password, row.encrypted + ).run()