fix: owner getting added to google event participant list (#33939)

This commit is contained in:
Anoop 2025-09-08 14:23:37 +05:30 committed by GitHub
parent 93ebe2f19f
commit 804e211b2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -798,16 +798,18 @@ def get_conference_data(doc):
def get_attendees(doc):
"""Return a list of dicts with attendee emails, if available in event_participants table."""
attendees, email_not_found = [], []
owner = frappe.db.get_value("Google Calendar", doc.google_calendar, "user")
for participant in doc.event_participants:
if participant.get("email"):
attendees.append({"email": participant.email})
p_email = participant.get("email")
if participant and p_email != owner:
attendees.append({"email": p_email})
else:
email_not_found.append({"dt": participant.reference_doctype, "dn": participant.reference_docname})
if email_not_found:
frappe.msgprint(
_("Google Calendar - Contact / email not found. Did not add attendee for -<br>{0}").format(
_("Contact / email not found. Did not add attendee for -<br>{0}").format(
"<br>".join(f"{d.get('dt')} {d.get('dn')}" for d in email_not_found)
),
alert=True,