From 8bc26b856dfd58908949f1f654d255e5336b2bf4 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 23 Dec 2011 16:16:03 +0530 Subject: [PATCH] Changed regex while validating column name --- py/webnotes/model/db_schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/webnotes/model/db_schema.py b/py/webnotes/model/db_schema.py index eb9f73f36f..71f40b4751 100644 --- a/py/webnotes/model/db_schema.py +++ b/py/webnotes/model/db_schema.py @@ -387,7 +387,7 @@ class DbManager: def validate_column_name(n): n = n.replace(' ','_').strip().lower() import re - if not re.match("[a-zA-Z_][a-zA-Z0-9_]*$", n): + if re.search("[\W]", n): webnotes.msgprint('err:%s is not a valid fieldname.
A valid name must contain letters / numbers / spaces.
Tip: You can change the Label after the fieldname has been set' % n) raise Exception return n