fix: Incorrect use of the Walrus operator

Incorrect use of the Walrus operator leads to unintended behavior for if-condition: "None" will be appended to cc.
This commit is contained in:
Patrick.St 2023-02-21 16:13:07 +01:00 committed by GitHub
parent c2ed98602a
commit 2a80bb01ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,7 +70,7 @@ class CommunicationEmailMixin:
if include_sender:
cc.append(self.sender_mailid)
if is_inbound_mail_communcation:
if (doc_owner := self.get_owner()) not in frappe.STANDARD_USERS:
if (doc_owner := self.get_owner()) and (doc_owner not in frappe.STANDARD_USERS):
cc.append(doc_owner)
cc = set(cc) - {self.sender_mailid}
cc.update(self.get_assignees())