fix: add backward compatibility for 5 item filter (#28678)

This commit is contained in:
David Arnold 2024-12-05 10:10:45 +01:00 committed by GitHub
parent eb6260c1c3
commit 6e02bfedcd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View file

@ -103,7 +103,7 @@ jobs:
if pgrep honcho > /dev/null; then
echo "Stopping honcho process..."
pgrep honcho | xargs kill
sleep 3
sleep 5
fi
echo "Setting up environment..."

View file

@ -97,6 +97,15 @@ class FilterTuple(_FilterTuple):
fieldname, operator, value = s
elif len(s) == 4: # type: ignore[redundant-expr]
doctype, fieldname, operator, value = s
elif len(s) == 5: # type: ignore[unreachable]
from frappe.deprecation_dumpster import deprecation_warning
deprecation_warning(
"2024-12-05",
"v16",
f"List type filters now should have 2, 3 or 4 elements: got 5 (Input: {s!r}). Hint: you probably need to remove the last filter element, a no-op from history.",
)
doctype, fieldname, operator, value, _noop = s
else:
raise ValueError(f"Invalid sequence length: {len(s)}. Expected 2, 3, or 4 elements.")
if is_unspecified(doctype) or doctype is None: