From 2aa4186af5c7bb83f5c4e31518d90ac1edce8b48 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Thu, 14 Sep 2017 22:10:55 +0530 Subject: [PATCH] Explicitly convert filter object to string --- frappe/custom/doctype/custom_field/custom_field.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/custom/doctype/custom_field/custom_field.py b/frappe/custom/doctype/custom_field/custom_field.py index c81ad6cdf4..6eb3eef544 100644 --- a/frappe/custom/doctype/custom_field/custom_field.py +++ b/frappe/custom/doctype/custom_field/custom_field.py @@ -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()