|
@@ -656,7 +656,7 @@ class DocType(Document): |
|
|
flags = {"flags": re.ASCII} if six.PY3 else {} |
|
|
flags = {"flags": re.ASCII} if six.PY3 else {} |
|
|
|
|
|
|
|
|
# a DocType name should not start or end with an empty space |
|
|
# a DocType name should not start or end with an empty space |
|
|
if re.match("^[ \t\n\r]+|[ \t\n\r]+$", name, **flags): |
|
|
|
|
|
|
|
|
if re.search("^[ \t\n\r]+|[ \t\n\r]+$", name, **flags): |
|
|
frappe.throw(_("DocType's name should not start or end with whitespace"), frappe.NameError) |
|
|
frappe.throw(_("DocType's name should not start or end with whitespace"), frappe.NameError) |
|
|
|
|
|
|
|
|
# a DocType's name should not start with a number or underscore |
|
|
# a DocType's name should not start with a number or underscore |
|
|