[minor] minor fixes for contact us page

This commit is contained in:
Makarand Bauskar 2017-02-20 10:25:25 +05:30 committed by mbauskar
parent 97ab1d2eb3
commit 98f9427ba1

View File

@ -14,7 +14,10 @@ def send_message(subject="Website Query", message="", sender="", status="Open"):
website_send_message(subject, message, sender)
customer = frappe.db.get_value('Contact', dict(email_id=sender), 'customer')
customer = frappe.db.sql("""select distinct dl.link_name from `tabDynamic Link` dl
left join `tabContact` c on dl.parent=c.name where dl.link_doctype='Customer'
and c.email_id='{email_id}'""".format(email_id=sender))
if not customer:
lead = frappe.db.get_value('Lead', dict(email_id=sender))
if not lead:
@ -33,7 +36,7 @@ def send_message(subject="Website Query", message="", sender="", status="Open"):
))
if customer:
opportunity.customer = customer
opportunity.customer = customer[0][0]
elif lead:
opportunity.lead = lead
else: