From 19e2a5b9f92ea4e89591fdbf01208d84632006f1 Mon Sep 17 00:00:00 2001 From: wojiushixiaobai <296015668@qq.com> Date: Sat, 6 Mar 2021 17:09:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(terminal):=20=E4=BF=AE=E6=AD=A3=E5=BD=95?= =?UTF-8?q?=E5=83=8F=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/api/session.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/terminal/api/session.py b/apps/terminal/api/session.py index 805b9b4a1..2a749aac5 100644 --- a/apps/terminal/api/session.py +++ b/apps/terminal/api/session.py @@ -76,8 +76,7 @@ class SessionViewSet(OrgBulkModelViewSet): session = self.get_object() local_path, url = utils.get_session_replay_url(session) if local_path is None: - error = url - return HttpResponse(error) + return Response({"error": url}, status=404) file = self.prepare_offline_file(session, local_path) response = FileResponse(file) @@ -167,7 +166,7 @@ class SessionReplayViewSet(AsyncApiMixin, viewsets.ViewSet): if not local_path: local_path, url = download_session_replay(session) if not local_path: - return Response({"error": url}) + return Response({"error": url}, status=404) data = self.get_replay_data(session, url) return Response(data)