[py3] Convert filter object to list (#15260)
This commit is contained in:
parent
91ac26c2ff
commit
ee8f8281b4
@ -98,7 +98,7 @@ def upload():
|
||||
from frappe.modules import scrub
|
||||
|
||||
rows = read_csv_content_from_uploaded_file()
|
||||
rows = filter(lambda x: x and any(x), rows)
|
||||
rows = list(filter(lambda x: x and any(x), rows))
|
||||
if not rows:
|
||||
msg = [_("Please select a csv file")]
|
||||
return {"messages": msg, "error": msg}
|
||||
|
@ -45,8 +45,8 @@ class EmailDigest(Document):
|
||||
# send email only to enabled users
|
||||
valid_users = [p[0] for p in frappe.db.sql("""select name from `tabUser`
|
||||
where enabled=1""")]
|
||||
recipients = filter(lambda r: r in valid_users,
|
||||
self.recipient_list.split("\n"))
|
||||
recipients = list(filter(lambda r: r in valid_users,
|
||||
self.recipient_list.split("\n")))
|
||||
|
||||
original_user = frappe.session.user
|
||||
|
||||
|
@ -49,7 +49,7 @@ class NamingSeries(Document):
|
||||
}
|
||||
|
||||
def scrub_options_list(self, ol):
|
||||
options = filter(lambda x: x, [cstr(n).strip() for n in ol])
|
||||
options = list(filter(lambda x: x, [cstr(n).strip() for n in ol]))
|
||||
return options
|
||||
|
||||
def update_series(self, arg=None):
|
||||
|
@ -61,7 +61,7 @@ class StockReconciliation(StockController):
|
||||
- flt(qty, item.precision("qty")) * flt(rate, item.precision("valuation_rate")))
|
||||
return True
|
||||
|
||||
items = filter(lambda d: _changed(d), self.items)
|
||||
items = list(filter(lambda d: _changed(d), self.items))
|
||||
|
||||
if not items:
|
||||
frappe.throw(_("None of the items have any change in quantity or value."),
|
||||
|
Loading…
x
Reference in New Issue
Block a user