fix: correct type check in sql_like function (#34076)

This commit is contained in:
Raffael Meyer 2025-09-22 12:52:21 +02:00 committed by GitHub
parent 6d8d7bb90b
commit 83d221c104
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2008,7 +2008,7 @@ def get_url_to_report_with_filters(name, filters, report_type=None, doctype=None
def sql_like(value: str, pattern: str) -> bool:
if not isinstance(pattern, str) and isinstance(value, str):
if not (isinstance(pattern, str) and isinstance(value, str)):
return False
if pattern.startswith("%") and pattern.endswith("%"):
return pattern.strip("%") in value