(chat_info, chat_record_id)
| 377 | |
| 378 | @staticmethod |
| 379 | def get_chat_record(chat_info, chat_record_id): |
| 380 | if chat_info is not None: |
| 381 | chat_record_list = [chat_record for chat_record in chat_info.chat_record_list if |
| 382 | str(chat_record.id) == str(chat_record_id)] |
| 383 | if chat_record_list is not None and len(chat_record_list): |
| 384 | return chat_record_list[-1] |
| 385 | chat_record = QuerySet(ChatRecord).filter(id=chat_record_id, chat_id=chat_info.chat_id).first() |
| 386 | if chat_record is None: |
| 387 | if not is_valid_uuid(chat_record_id): |
| 388 | raise ChatException(500, _("Conversation record does not exist")) |
| 389 | chat_record = QuerySet(ChatRecord).filter(id=chat_record_id).first() |
| 390 | return chat_record |
| 391 | |
| 392 | def chat_work_flow(self, chat_info: ChatInfo, instance: dict, base_to_response): |
| 393 | message = instance.get('message') |
no test coverage detected