Skip to content

Commit

Permalink
Update contact.py
Browse files Browse the repository at this point in the history
file revert
  • Loading branch information
ashishverma8848 authored Dec 5, 2024
1 parent 07b85bb commit 6cf2f0c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions frappe/contacts/doctype/contact/contact.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,9 @@ def get_contact_with_phone_number(number):
return contacts[0].parent if contacts else None


def get_contact_name(email_id: str) -> str | None:
"""Return the contact ID for the given email ID."""
for contact_id in frappe.get_all(
"Contact Email", filters={"email_id": email_id, "parenttype": "Contact"}, pluck="parent"
):
if frappe.db.exists("Contact", contact_id):
return contact_id
def get_contact_name(email_id):
contact = frappe.get_all("Contact Email", filters={"email_id": email_id}, fields=["parent"], limit=1)
return contact[0].parent if contact else None


def get_contacts_linking_to(doctype, docname, fields=None):
Expand Down

0 comments on commit 6cf2f0c

Please sign in to comment.