Skip to content

Commit

Permalink
fix(Data Import): scheduler not needed in dev mode (backport #24667) (#…
Browse files Browse the repository at this point in the history
…26265)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
  • Loading branch information
mergify[bot] and barredterra committed Apr 30, 2024
1 parent 57ae4fe commit 9ce789e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frappe/core/doctype/data_import/data_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def get_preview_from_template(self, import_file=None, google_sheets_url=None):
def start_import(self):
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"data_import::{self.name}"
Expand All @@ -105,7 +106,7 @@ def start_import(self):
event="data_import",
job_id=job_id,
data_import=self.name,
now=frappe.conf.developer_mode or frappe.flags.in_test,
now=run_now,
)
return True

Expand Down

0 comments on commit 9ce789e

Please sign in to comment.