From bab692ff599fcb3ab7bf8388f616b94f4f991652 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Mon, 31 Jul 2017 10:50:26 +0530 Subject: [PATCH] Replaced mixed usage of tabs and spaces for indents with tabs only (#3813) Python 3 (PEP 8) strictly disallows mixed use of tabs and spaces for indentation frappe innstalltion only throws error on frappe/utils/jinja.py as of now but the rest are almost equally likely to fail, so changed all of them in one commit --- frappe/utils/boilerplate.py | 2 +- frappe/utils/global_search.py | 6 +++--- frappe/utils/jinja.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frappe/utils/boilerplate.py b/frappe/utils/boilerplate.py index b94ef134d1..53b20102ad 100755 --- a/frappe/utils/boilerplate.py +++ b/frappe/utils/boilerplate.py @@ -39,7 +39,7 @@ def make_boilerplate(dest, app_name): if hook_key=="app_name" and hook_val.lower().replace(" ", "_") != hook_val: print("App Name must be all lowercase and without spaces") - hook_val = "" + hook_val = "" elif hook_key=="app_title" and not re.match("^(?![\W])[^\d_\s][\w -]+$", hook_val, re.UNICODE): print("App Title should start with a letter and it can only consist of letters, numbers, spaces and underscores") hook_val = "" diff --git a/frappe/utils/global_search.py b/frappe/utils/global_search.py index 2351ee8960..a92222731e 100644 --- a/frappe/utils/global_search.py +++ b/frappe/utils/global_search.py @@ -218,9 +218,9 @@ def update_global_search(doc): # Get children for child in doc.meta.get_table_fields(): for d in doc.get(child.fieldname): - if d.parent == doc.name: - for field in d.meta.get_global_search_fields(): - if d.get(field.fieldname): + if d.parent == doc.name: + for field in d.meta.get_global_search_fields(): + if d.get(field.fieldname): content.append(get_formatted_value(d.get(field.fieldname), field)) if content: diff --git a/frappe/utils/jinja.py b/frappe/utils/jinja.py index cccf4f079c..4827363415 100644 --- a/frappe/utils/jinja.py +++ b/frappe/utils/jinja.py @@ -47,7 +47,7 @@ def validate_template(html): try: jenv.from_string(html) except TemplateSyntaxError as e: - frappe.msgprint('Line {}: {}'.format(e.lineno, e.message)) + frappe.msgprint('Line {}: {}'.format(e.lineno, e.message)) frappe.throw(frappe._("Syntax error in template")) def render_template(template, context, is_path=None):