Merge pull request #17123 from gavindsouza/refactor-re-fixes

fix: Regex compilation in boilerplate utils
This commit is contained in:
gavin 2022-06-09 12:22:27 +05:30 committed by GitHub
commit 41da2ba50b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,7 +11,7 @@ import git
import frappe
from frappe.utils import touch_file
APP_TITLE_PATTERN = re.compile(r"^(?![\W])[^\d_\s][\w -]+$")
APP_TITLE_PATTERN = re.compile(r"^(?![\W])[^\d_\s][\w -]+$", flags=re.UNICODE)
def make_boilerplate(dest, app_name, no_git=False):
@ -69,7 +69,7 @@ def _get_user_inputs(app_name):
def is_valid_title(title) -> bool:
if not APP_TITLE_PATTERN.match(title, re.UNICODE):
if not APP_TITLE_PATTERN.match(title):
print(
"App Title should start with a letter and it can only consist of letters, numbers, spaces and underscores"
)