From ac81440a81afa6417de2d688d277176b5ea8f6b9 Mon Sep 17 00:00:00 2001 From: Felipe Orellana Date: Thu, 12 Jan 2017 12:08:20 -0500 Subject: [PATCH] [FIX] Contact form breaks on existing lead When an email address from the contacts form is from a existing lead utils.py tries to set new_lead(an undefined var) as the lead reference if a lead is found. --- erpnext/templates/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/templates/utils.py b/erpnext/templates/utils.py index 94f924243c..c1405c374f 100644 --- a/erpnext/templates/utils.py +++ b/erpnext/templates/utils.py @@ -34,6 +34,8 @@ def send_message(subject="Website Query", message="", sender="", status="Open"): if customer: opportunity.customer = customer + elif lead: + opportunity.lead = lead else: opportunity.lead = new_lead.name