瀏覽代碼

Allow non-english field names in Custom Field #919

version-14
Anand Doshi 10 年之前
父節點
當前提交
e5e80a27a3
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. +2
    -2
      frappe/model/db_schema.py

+ 2
- 2
frappe/model/db_schema.py 查看文件

@@ -8,6 +8,7 @@ Syncs a database table to the `DocType` (metadata)
.. note:: This module is only used internally .. note:: This module is only used internally


""" """
import re
import os import os
import frappe import frappe
from frappe import _ from frappe import _
@@ -401,8 +402,7 @@ class DbManager:


def validate_column_name(n): def validate_column_name(n):
n = n.replace(' ','_').strip().lower() n = n.replace(' ','_').strip().lower()
import re
if re.search("[\W]", n):
if re.search("[\W]", n, re.UNICODE):
frappe.throw(_("Fieldname {0} cannot contain letters, numbers or spaces").format(n), InvalidColumnName) frappe.throw(_("Fieldname {0} cannot contain letters, numbers or spaces").format(n), InvalidColumnName)
return n return n




Loading…
取消
儲存