Explicitly convert filter object to string

This commit is contained in:
Aditya Hase 2017-09-14 22:10:55 +05:30
parent 234fca90a3
commit 2aa4186af5

View file

@ -18,8 +18,8 @@ class CustomField(Document):
if not self.label:
frappe.throw(_("Label is mandatory"))
# remove special characters from fieldname
self.fieldname = filter(lambda x: x.isdigit() or x.isalpha() or '_',
cstr(self.label).lower().replace(' ','_'))
self.fieldname = "".join(filter(lambda x: x.isdigit() or x.isalpha() or '_',
cstr(self.label).lower().replace(' ','_')))
# fieldnames should be lowercase
self.fieldname = self.fieldname.lower()