[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.
diff --git a/erpnext/templates/utils.py b/erpnext/templates/utils.py
index 94f9242..c1405c3 100644
--- a/erpnext/templates/utils.py
+++ b/erpnext/templates/utils.py
@@ -34,6 +34,8 @@
if customer:
opportunity.customer = customer
+ elif lead:
+ opportunity.lead = lead
else:
opportunity.lead = new_lead.name