Browse Source

Explicitly convert filter to list wherever necessary

version-14
Aditya Hase 7 years ago
parent
commit
f7b7387b46
3 changed files with 3 additions and 3 deletions
  1. +1
    -1
      frappe/core/doctype/doctype/doctype.py
  2. +1
    -1
      frappe/core/doctype/module_def/module_def.py
  3. +1
    -1
      frappe/core/page/data_import_tool/importer.py

+ 1
- 1
frappe/core/doctype/doctype/doctype.py View File

@@ -451,7 +451,7 @@ def validate_fields(meta):

def check_dynamic_link_options(d):
if d.fieldtype=="Dynamic Link":
doctype_pointer = filter(lambda df: df.fieldname==d.options, fields)
doctype_pointer = list(filter(lambda df: df.fieldname==d.options, fields))
if not doctype_pointer or (doctype_pointer[0].fieldtype not in ("Link", "Select")) \
or (doctype_pointer[0].fieldtype=="Link" and doctype_pointer[0].options!="DocType"):
frappe.throw(_("Options 'Dynamic Link' type of field must point to another Link Field with options as 'DocType'"))


+ 1
- 1
frappe/core/doctype/module_def/module_def.py View File

@@ -30,7 +30,7 @@ class ModuleDef(Document):
with open(frappe.get_app_path(self.app_name, "modules.txt"), "r") as f:
content = f.read()
if not self.name in content.splitlines():
modules = filter(None, content.splitlines())
modules = list(filter(None, content.splitlines()))
modules.append(self.name)

if modules:


+ 1
- 1
frappe/core/page/data_import_tool/importer.py View File

@@ -72,7 +72,7 @@ def upload(rows = None, submit_after_import=None, ignore_encoding_errors=False,
return [], -1

def filter_empty_columns(columns):
empty_cols = filter(lambda x: x in ("", None), columns)
empty_cols = list(filter(lambda x: x in ("", None), columns))

if empty_cols:
if columns[-1*len(empty_cols):] == empty_cols:


Loading…
Cancel
Save