fix: consider reference docname when reference doctype is Contact when setting participant emails in event doctype (#18463)

This commit is contained in:
Ritwik Puri 2022-10-20 03:02:05 +05:30 committed by GitHub
parent 1e2370ffd3
commit 1bf384f81d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -143,9 +143,13 @@ class Event(Document):
if participant.email:
continue
participant_contact = get_default_contact(
participant.reference_doctype, participant.reference_docname
)
if participant.reference_doctype != "Contact":
participant_contact = get_default_contact(
participant.reference_doctype, participant.reference_docname
)
else:
participant_contact = participant.reference_docname
participant.email = (
frappe.get_value("Contact", participant_contact, "email_id") if participant_contact else None
)