(self, instance: dict, base_to_response: BaseToResponse = SystemToResponse())
| 454 | raise ChatException(500, _("The chat user is not authorized.")) |
| 455 | |
| 456 | def chat(self, instance: dict, base_to_response: BaseToResponse = SystemToResponse()): |
| 457 | super().is_valid(raise_exception=True) |
| 458 | ChatMessageSerializers(data=instance).is_valid(raise_exception=True) |
| 459 | chat_info = self.get_chat_info() |
| 460 | chat_info.get_application() |
| 461 | chat_info.get_chat_user(asker=(instance.get('form_data') or {}).get('asker')) |
| 462 | self.is_valid_chat_id(chat_info) |
| 463 | if not self.data.get('debug'): |
| 464 | self.is_valid_chat_user() |
| 465 | if chat_info.application.type == ApplicationTypeChoices.SIMPLE: |
| 466 | self.is_valid_application_simple(raise_exception=True, chat_info=chat_info) |
| 467 | return self.chat_simple(chat_info, instance, base_to_response) |
| 468 | else: |
| 469 | self.is_valid_application_workflow(raise_exception=True) |
| 470 | return self.chat_work_flow(chat_info, instance, base_to_response) |
| 471 | |
| 472 | def get_chat_info(self): |
| 473 | self.is_valid(raise_exception=True) |
no test coverage detected