fix: compare folder names for uniqueness with lower() equality instead of a LIKE pattern (#28695)

This commit is contained in:
G30 2026-08-17 02:00:02 -04:00 committed by GitHub
parent e4694d6c3f
commit 1d1c14bd77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -230,7 +230,9 @@ class FolderTable:
async with get_async_db_context(db) as db:
# Check if folder exists
result = await db.execute(
select(Folder).filter_by(parent_id=parent_id, user_id=user_id).filter(Folder.name.ilike(name))
select(Folder)
.filter_by(parent_id=parent_id, user_id=user_id)
.filter(func.lower(Folder.name) == func.lower(name))
)
folder = result.scalars().first()