Skip to content

Commit 425d82b

Browse files
顺便修复几个问题。
1 parent a39b3a5 commit 425d82b

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

apps/application/serializers/application_chat_record.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ def is_valid(self, *, raise_exception=False):
104104
def list(self, with_valid=True):
105105
if with_valid:
106106
self.is_valid(raise_exception=True)
107-
QuerySet(ChatRecord).filter(chat_id=self.data.get('chat_id'))
108107
order_by = 'create_time' if self.data.get('order_asc') is None or self.data.get(
109108
'order_asc') else '-create_time'
110109
return [ChatRecordSerializerModel(chat_record).data for chat_record in
@@ -169,7 +168,7 @@ def reset_chat_record(chat_record, show_source, show_exec):
169168
'padding_problem_text': chat_record.details.get('problem_padding').get(
170169
'padding_problem_text') if 'problem_padding' in chat_record.details else None,
171170
**(show_source_dict if show_source else {}),
172-
**(show_exec_dict if show_exec else show_exec_dict)
171+
**(show_exec_dict if show_exec else {})
173172
}
174173

175174
def page(self, current_page: int, page_size: int, with_valid=True, show_source=None, show_exec=None):

apps/chat/serializers/chat_record.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def vote(self, instance: Dict, with_valid=True):
7676
chat_record_details_model.vote_reason = vote_reason
7777
chat_record_details_model.vote_other_content = vote_other_content
7878

79-
if vote_status == VoteChoices.TRAMPLE:
79+
elif vote_status == VoteChoices.TRAMPLE:
8080
# 点踩
8181
chat_record_details_model.vote_status = VoteChoices.TRAMPLE
8282
chat_record_details_model.vote_reason = vote_reason

apps/knowledge/serializers/paragraph.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ def edit(self, instance: Dict):
226226
return self.one(), instance, self.data.get('knowledge_id')
227227

228228
def get_problem_list(self):
229-
ProblemParagraphMapping(ProblemParagraphMapping)
230229
problem_paragraph_mapping = QuerySet(ProblemParagraphMapping).filter(
231230
paragraph_id=self.data.get("paragraph_id"))
232231
if len(problem_paragraph_mapping) > 0:

0 commit comments

Comments
 (0)