chore: format

This commit is contained in:
Timothy Jaeryang Baek
2026-02-16 00:43:32 -06:00
parent c748c3ede7
commit 09dc28df1e
66 changed files with 212 additions and 26 deletions
+2 -6
View File
@@ -451,9 +451,7 @@ class ChatTable:
# Clean up orphaned old tags in one query
removed = set(old_tags) - set(new_tag_ids)
if removed:
self.delete_orphan_tags_for_user(
list(removed), user.id, db=db
)
self.delete_orphan_tags_for_user(list(removed), user.id, db=db)
return ChatModel.model_validate(chat)
@@ -1380,9 +1378,7 @@ class ChatTable:
with get_db_context(db) as db:
orphans = []
for tag_id in tag_ids:
count = self.count_chats_by_tag_name_and_user_id(
tag_id, user_id, db=db
)
count = self.count_chats_by_tag_name_and_user_id(tag_id, user_id, db=db)
if count <= threshold:
orphans.append(tag_id)
Tags.delete_tags_by_ids_and_user_id(orphans, user_id, db=db)
+1 -5
View File
@@ -218,11 +218,7 @@ class GroupTable:
)
)
results = (
query.group_by(Group.id)
.order_by(Group.updated_at.desc())
.all()
)
results = query.group_by(Group.id).order_by(Group.updated_at.desc()).all()
return [
GroupResponse.model_validate(
+3 -3
View File
@@ -123,9 +123,9 @@ class TagTable:
return True
try:
with get_db_context(db) as db:
db.query(Tag).filter(
Tag.id.in_(ids), Tag.user_id == user_id
).delete(synchronize_session=False)
db.query(Tag).filter(Tag.id.in_(ids), Tag.user_id == user_id).delete(
synchronize_session=False
)
db.commit()
return True
except Exception as e: