diff --git a/frappe/utils/fixtures.py b/frappe/utils/fixtures.py index 2c56d953d6..c82ae2170b 100644 --- a/frappe/utils/fixtures.py +++ b/frappe/utils/fixtures.py @@ -12,6 +12,9 @@ def sync_fixtures(app=None): apps = [app] else: apps = frappe.get_installed_apps() + + frappe.flags.in_fixtures = True + for app in apps: if os.path.exists(frappe.get_app_path(app, "fixtures")): fixture_files = sorted(os.listdir(frappe.get_app_path(app, "fixtures"))) @@ -21,6 +24,8 @@ def sync_fixtures(app=None): import_custom_scripts(app) + frappe.flags.in_fixtures = False + frappe.db.commit() def import_custom_scripts(app): diff --git a/frappe/website/doctype/web_form/web_form.py b/frappe/website/doctype/web_form/web_form.py index 80803a29bd..379d38d194 100644 --- a/frappe/website/doctype/web_form/web_form.py +++ b/frappe/website/doctype/web_form/web_form.py @@ -22,7 +22,7 @@ class WebForm(WebsiteGenerator): self.use_meta_fields() def validate(self): - if (not (frappe.flags.in_install or frappe.flags.in_patch or frappe.flags.in_test) + if (not (frappe.flags.in_install or frappe.flags.in_patch or frappe.flags.in_test or frappe.flags.in_fixtures) and self.is_standard and not frappe.conf.developer_mode): frappe.throw(_("You need to be in developer mode to edit a Standard Web Form"))