From 16f6ba4d2f63ab4c03f78aa3f01df718af7a52c8 Mon Sep 17 00:00:00 2001 From: Himanshu Warekar Date: Fri, 20 Dec 2019 13:36:09 +0530 Subject: [PATCH] fix: rename first_name --- frappe/core/doctype/communication/communication.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frappe/core/doctype/communication/communication.py b/frappe/core/doctype/communication/communication.py index 8e4c5c357d..5c8983ea22 100644 --- a/frappe/core/doctype/communication/communication.py +++ b/frappe/core/doctype/communication/communication.py @@ -356,13 +356,13 @@ def get_contacts(email_strings): first_name = frappe.unscrub(email_parts[0]) try: + contact_name = '{0}-{1}'.format(first_name, email_parts[1]) if first_name == 'Contact' else first_name contact = frappe.get_doc({ "doctype": "Contact", - "first_name": first_name, + "first_name": contact_name, + "name": contact_name }) contact.add_email(email_id=email, is_primary=True) - contact.name = ('{0}-{1}'.format(first_name, email_parts[1]) - if first_name == 'Contact' else first_name) contact.insert(ignore_permissions=True) contact_name = contact.name except Exception: