Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tagstudio/src/core/library/alchemy/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ def search_tags(
if search.tag:
query = query.where(
or_(
Tag.name.ilike(search.tag),
Tag.shorthand.ilike(search.tag),
Tag.name.icontains(search.tag),
Tag.shorthand.icontains(search.tag),
)
)

Expand Down
4 changes: 4 additions & 0 deletions tagstudio/tests/test_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ def test_tag_search(library):
FilterState(tag=tag.name.upper()),
)

assert library.search_tags(
FilterState(tag=tag.name[2:-2])
)

assert not library.search_tags(
FilterState(tag=tag.name * 2),
)
Expand Down