[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.
This commit is contained in:
Felipe Orellana 2017-01-12 12:08:20 -05:00 committed by GitHub
parent 5dfffe7586
commit ac81440a81

View File

@ -34,6 +34,8 @@ def send_message(subject="Website Query", message="", sender="", status="Open"):
if customer: if customer:
opportunity.customer = customer opportunity.customer = customer
elif lead:
opportunity.lead = lead
else: else:
opportunity.lead = new_lead.name opportunity.lead = new_lead.name