mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-05-20 15:55:19 +00:00
fix: empty ORLists now return false (#1297)
* fix: empty ORLists now return false * fix: replace invalid tags with false when building sql query
This commit is contained in:
@@ -6,7 +6,7 @@ import re
|
||||
from typing import TYPE_CHECKING, override
|
||||
|
||||
import structlog
|
||||
from sqlalchemy import ColumnElement, and_, distinct, func, or_, select
|
||||
from sqlalchemy import ColumnElement, and_, distinct, false, func, or_, select
|
||||
from sqlalchemy.orm import Session
|
||||
from sqlalchemy.sql.operators import ilike_op
|
||||
|
||||
@@ -163,6 +163,9 @@ class SQLBoolExpressionBuilder(BaseVisitor[ColumnElement[bool]]):
|
||||
continue
|
||||
case ConstraintType.Tag:
|
||||
ids = self.__get_tag_ids(term.value)
|
||||
if len(ids) == 0:
|
||||
bool_expressions.append(false())
|
||||
continue
|
||||
if not only_single:
|
||||
tag_ids.update(ids)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user