From 15f8e19574827a5cebae7f7bb9213bcbe5d4f643 Mon Sep 17 00:00:00 2001 From: Himanshu Date: Mon, 1 Jul 2019 13:45:40 +0530 Subject: [PATCH] fix(Google Contacts): explicit db.commit (#7791) --- frappe/integrations/doctype/google_contacts/google_contacts.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frappe/integrations/doctype/google_contacts/google_contacts.py b/frappe/integrations/doctype/google_contacts/google_contacts.py index 67f1baf30a..0ea65d7c68 100644 --- a/frappe/integrations/doctype/google_contacts/google_contacts.py +++ b/frappe/integrations/doctype/google_contacts/google_contacts.py @@ -73,6 +73,7 @@ def authorize_access(g_contact, reauthorize=None): if "refresh_token" in r: frappe.db.set_value("Google Contacts", google_contact.name, "refresh_token", r.get("refresh_token")) + frappe.db.commit() frappe.local.response["type"] = "redirect" frappe.local.response["location"] = "/desk#Form/Google%20Contacts/{}".format(google_contact.name) @@ -93,6 +94,7 @@ def google_callback(client_id=None, redirect_uri=None, code=None): else: google_contact = frappe.cache().hget("google_contacts", "google_contact") frappe.db.set_value("Google Contacts", google_contact, "authorization_code", code) + frappe.db.commit() authorize_access(google_contact)