Переглянути джерело

Merge pull request #12338 from hasnain2808/compile-re-before-execute

fix: trailing spaces match only when re compile
version-14
mergify[bot] 4 роки тому
committed by GitHub
джерело
коміт
99f0b223ce
Не вдалося знайти GPG ключ що відповідає даному підпису Ідентифікатор GPG ключа: 4AEE18F83AFDEB23
1 змінених файлів з 1 додано та 1 видалено
  1. +1
    -1
      frappe/core/doctype/doctype/doctype.py

+ 1
- 1
frappe/core/doctype/doctype/doctype.py Переглянути файл

@@ -656,7 +656,7 @@ class DocType(Document):
flags = {"flags": re.ASCII} if six.PY3 else {}

# 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)

# a DocType's name should not start with a number or underscore


Завантаження…
Відмінити
Зберегти