From 86581966504d7ad1dc9e0a59773b010db7040cb5 Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Fri, 29 Mar 2024 14:05:33 +0530 Subject: [PATCH] fix(enqueue): pass the original method argument here Don't pass the stringified version - this is what goes to RQ, and the string we construct isn't always "correct" For example, https://github.com/frappe/frappe/blob/87d121f47a4afc507442a97bf1854bb3d17f42c6/frappe/email/doctype/email_queue/email_queue.py#L735-L736 generates `frappe.email.doctype.email_queue.email_queue.QueueBuilder.send_emails` which will result in `ModuleNotFoundError: No module named 'frappe.email.doctype.email_queue.email_queue.QueueBuilder'; 'frappe.email.doctype.email_queue.email_queue' is not a package` Signed-off-by: Akhil Narang --- frappe/utils/background_jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/utils/background_jobs.py b/frappe/utils/background_jobs.py index fd94757b51..2d373f10f7 100644 --- a/frappe/utils/background_jobs.py +++ b/frappe/utils/background_jobs.py @@ -151,7 +151,7 @@ def enqueue( queue_args = { "site": frappe.local.site, "user": frappe.session.user, - "method": method_name, + "method": method, "event": event, "job_name": job_name or method_name, "is_async": is_async,