fix: (Linter) Write queries using QB/ORM and other minor lines for semgrep to skip

This commit is contained in:
marination
2022-02-02 12:58:31 +05:30
parent 780e29b42e
commit 4b62d2d7fe
13 changed files with 89 additions and 84 deletions

View File

@@ -99,18 +99,14 @@ class ProductFiltersBuilder:
if not attributes:
return []
result = frappe.db.sql(
"""
select
distinct attribute, attribute_value
from
`tabItem Variant Attribute`
where
attribute in %(attributes)s
and attribute_value is not null
""",
{"attributes": attributes},
as_dict=1,
result = frappe.get_all(
"Item Variant Attribute",
filters={
"attribute": ["in", attributes],
"attribute_value": ["is", "set"]
},
fields=["attribute", "attribute_value"],
distinct=True
)
attribute_value_map = {}