Skip to content

Commit

Permalink
fix(Bank Statement Import): scheduler not needed in dev mode (frappe#…
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra authored Feb 3, 2024
1 parent 6d87cfe commit 93259ca
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ def start_import(self):
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}"
Expand All @@ -97,7 +98,7 @@ def start_import(self):
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

Expand Down

0 comments on commit 93259ca

Please sign in to comment.