[minor] strip special characters when making a fieldname

This commit is contained in:
Rushabh Mehta 2018-05-25 15:47:28 +05:30
parent bcaabe5163
commit 5e09a3a9b8

View file

@ -182,6 +182,8 @@ class DocType(Document):
else:
d.fieldname = d.fieldtype.lower().replace(" ","_") + "_" + str(d.idx)
d.fieldname = re.sub('''['",./%@()<>{}]''', '', d.fieldname)
# fieldnames should be lowercase
d.fieldname = d.fieldname.lower()