fix: validate "format:" expression to only contain one set of {#} pattern
This commit is contained in:
parent
62d8d5875a
commit
aaefd066f0
1 changed files with 6 additions and 0 deletions
|
|
@ -1090,6 +1090,12 @@ def validate_series(dt, autoname=None, name=None):
|
|||
df.unique = 1
|
||||
break
|
||||
|
||||
if autoname and autoname.startswith("format:"):
|
||||
from frappe.model.naming import BRACED_PARAMS_HASH_PATTERN
|
||||
|
||||
if len(BRACED_PARAMS_HASH_PATTERN.findall(autoname)) > 1:
|
||||
frappe.throw(_("Only one set of {#} pattern is allowed in the format string"))
|
||||
|
||||
if (
|
||||
autoname
|
||||
and (not autoname.startswith("field:"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue