From fe0564505121333097e0527a69be2909fe3c40b3 Mon Sep 17 00:00:00 2001 From: Manas Solanki Date: Tue, 23 May 2017 17:13:26 +0530 Subject: [PATCH] fix issue when image not saved after attaching (#8957) --- erpnext/crm/doctype/lead/lead.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/crm/doctype/lead/lead.py b/erpnext/crm/doctype/lead/lead.py index e6659f38908..ccbb5369aab 100644 --- a/erpnext/crm/doctype/lead/lead.py +++ b/erpnext/crm/doctype/lead/lead.py @@ -43,7 +43,8 @@ class Lead(SellingController): if self.email_id == self.contact_by: frappe.throw(_("Next Contact By cannot be same as the Lead Email Address")) - self.image = has_gravatar(self.email_id) + if self.is_new() or not self.image: + self.image = has_gravatar(self.email_id) if self.contact_date and self.contact_date < now(): frappe.throw(_("Next Contact Date cannot be in the past"))