Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Data Import): scheduler not needed in dev mode #24667

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading