fix: only add expression if truthy

(Don't try to insert empty string)
Breaks on some v15 sites

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang 2025-02-05 11:59:13 +05:30
parent db3917d720
commit ec27c44872
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F

View file

@ -54,8 +54,8 @@ def execute():
for doc in docs:
_doc = frappe.get_doc(doctype.name, doc.name)
expr = doctype.autoname[7 : doctype.autoname.find("{#")]
key = BRACED_PARAMS_WORD_PATTERN.sub(get_param_value_for_word_match(_doc), expr)
uniq_exprs.add(key)
if key := BRACED_PARAMS_WORD_PATTERN.sub(get_param_value_for_word_match(_doc), expr):
uniq_exprs.add(key)
current = (frappe.qb.from_(Series).select("*").where(Series.name == "")).run(as_dict=True)
if current: