[minor] minor fixes for contact us page
This commit is contained in:
parent
97ab1d2eb3
commit
98f9427ba1
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user