Skip to content

Commit

Permalink
fix: send_workflow_action_email (#24929) (#24939)
Browse files Browse the repository at this point in the history
* fix: send_workflow_action_email

* fix: send_workflow_action_email

(cherry picked from commit 15eb1bf)

Co-authored-by: Nihantra C. Patel <141945075+Nihantra-Patel@users.noreply.github.com>
  • Loading branch information
mergify[bot] and Nihantra-Patel committed Feb 19, 2024
1 parent 651a9f8 commit 6c13a3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frappe/workflow/doctype/workflow_action/workflow_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def get_users_next_action_data(transitions, doc):
def user_has_permission(user: str) -> bool:
from frappe.permissions import has_permission

return has_permission(doctype=doc, user=user, print_logs=False)
return has_permission(doctype=doc, user=user)

for transition in transitions:
users = get_users_with_role(transition.allowed)
Expand Down Expand Up @@ -359,10 +359,10 @@ def send_workflow_action_email(doc, transitions):
users_data = get_users_next_action_data(transitions, doc)
common_args = get_common_email_args(doc)
message = common_args.pop("message", None)
for d in users_data:
for user, data in users_data.items(): # noqa: B007
email_args = {
"recipients": [d.get("email")],
"args": {"actions": list(deduplicate_actions(d.get("possible_actions"))), "message": message},
"recipients": [data.get("email")],
"args": {"actions": list(deduplicate_actions(data.get("possible_actions"))), "message": message},
"reference_name": doc.name,
"reference_doctype": doc.doctype,
}
Expand Down

0 comments on commit 6c13a3b

Please sign in to comment.