Skip to content

Commit dcceb1e

Browse files
committed
fix: handle empty terminology descriptions in chat
1 parent 1457557 commit dcceb1e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/apps/terminology/curd/terminology.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,9 @@ def select_terminology_by_word(session: SessionDep, word: str, oid: int, datasou
793793
for row in t_list:
794794
pid = str(row.pid) if row.pid is not None else str(row.id)
795795
if _map.get(pid) is None:
796-
_map[pid] = {'words': [], 'description': row.description}
796+
_map[pid] = {'words': [], 'description': ''}
797+
if row.pid is None:
798+
_map[pid]['description'] = row.description
797799
_map[pid]['words'].append(row.word)
798800

799801
_results: list[dict] = []

0 commit comments

Comments
 (0)