fix: check for numeric arg first
This commit is contained in:
parent
0d415afdd5
commit
17f9ca9819
1 changed files with 4 additions and 3 deletions
|
|
@ -2420,14 +2420,15 @@ class SQLFunctionParser:
|
||||||
).format(arg),
|
).format(arg),
|
||||||
frappe.ValidationError,
|
frappe.ValidationError,
|
||||||
)
|
)
|
||||||
elif self._is_valid_field_name(arg):
|
|
||||||
self._check_function_field_permission(arg)
|
|
||||||
return self.engine.table[arg]
|
|
||||||
|
|
||||||
# Check if it's a numeric string like "1" (for COUNT(1), etc.)
|
# Check if it's a numeric string like "1" (for COUNT(1), etc.)
|
||||||
elif arg.isdigit():
|
elif arg.isdigit():
|
||||||
return int(arg)
|
return int(arg)
|
||||||
|
|
||||||
|
elif self._is_valid_field_name(arg):
|
||||||
|
self._check_function_field_permission(arg)
|
||||||
|
return self.engine.table[arg]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
frappe.throw(
|
frappe.throw(
|
||||||
_(
|
_(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue