refactor(routines): use SQLAlchemy is_(False) for product filters
This commit is contained in:
parent
d3bd2ff30d
commit
258b8c4330
1 changed files with 2 additions and 4 deletions
|
|
@ -266,7 +266,7 @@ def _build_recent_history(session: Session) -> str:
|
|||
|
||||
|
||||
def _build_products_context(session: Session, time_filter: Optional[str] = None) -> str:
|
||||
stmt = select(Product).where(Product.is_tool == False) # noqa: E712
|
||||
stmt = select(Product).where(Product.is_tool.is_(False))
|
||||
products = session.exec(stmt).all()
|
||||
product_ids = [p.id for p in products]
|
||||
inventory_rows = (
|
||||
|
|
@ -335,9 +335,7 @@ def _build_products_context(session: Session, time_filter: Optional[str] = None)
|
|||
def _build_inventory_context(
|
||||
session: Session, time_filter: Optional[str] = None
|
||||
) -> str:
|
||||
products = session.exec(
|
||||
select(Product).where(Product.is_tool == False)
|
||||
).all() # noqa: E712
|
||||
products = session.exec(select(Product).where(Product.is_tool.is_(False))).all()
|
||||
product_ids = [p.id for p in products]
|
||||
inventory_rows = (
|
||||
session.exec(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue