Skip to content

Commit e2394b7

Browse files
authored
fix: empty ORLists now return false (#1297)
* fix: empty ORLists now return false * fix: replace invalid tags with false when building sql query
1 parent 5663e62 commit e2394b7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/tagstudio/core/library/alchemy/visitors.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from typing import TYPE_CHECKING, override
77

88
import structlog
9-
from sqlalchemy import ColumnElement, and_, distinct, func, or_, select
9+
from sqlalchemy import ColumnElement, and_, distinct, false, func, or_, select
1010
from sqlalchemy.orm import Session
1111
from sqlalchemy.sql.operators import ilike_op
1212

@@ -163,6 +163,9 @@ def __separate_tags(
163163
continue
164164
case ConstraintType.Tag:
165165
ids = self.__get_tag_ids(term.value)
166+
if len(ids) == 0:
167+
bool_expressions.append(false())
168+
continue
166169
if not only_single:
167170
tag_ids.update(ids)
168171
continue

0 commit comments

Comments
 (0)