fix(Bank Statement Import): scheduler not needed in dev mode (#39678)

This commit is contained in:
Raffael Meyer 2024-02-03 04:42:28 +01:00 committed by GitHub
parent 6d87cfeb8d
commit 93259cab1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -80,7 +80,8 @@ class BankStatementImport(DataImport):
from frappe.utils.background_jobs import is_job_enqueued
from frappe.utils.scheduler import is_scheduler_inactive
if is_scheduler_inactive() and not frappe.flags.in_test:
run_now = frappe.flags.in_test or frappe.conf.developer_mode
if is_scheduler_inactive() and not run_now:
frappe.throw(_("Scheduler is inactive. Cannot import data."), title=_("Scheduler Inactive"))
job_id = f"bank_statement_import::{self.name}"
@ -97,7 +98,7 @@ class BankStatementImport(DataImport):
google_sheets_url=self.google_sheets_url,
bank=self.bank,
template_options=self.template_options,
now=frappe.conf.developer_mode or frappe.flags.in_test,
now=run_now,
)
return True