fix: rename first_name

This commit is contained in:
Himanshu Warekar 2019-12-20 13:36:09 +05:30
parent 12e7bc025f
commit 16f6ba4d2f

View file

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