[fix] don't validate standard webform if in sync fixtures

This commit is contained in:
Anand Doshi 2016-03-01 17:13:12 +05:30
parent 4b550c4f49
commit 027e1d2131
2 changed files with 6 additions and 1 deletions

View file

@ -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):

View file

@ -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"))