Skip to content

Commit 4d1a264

Browse files
committed
use separate variable names to prevent typing issues
1 parent e654247 commit 4d1a264

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

src/sentry/replays/endpoints/organization_replay_details.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ def get(self, request: Request, organization: Organization, replay_id: str) -> R
213213
request_user_id=request.user.id,
214214
)
215215

216-
response = process_raw_response(
216+
replay_data = process_raw_response(
217217
snuba_response,
218218
fields=request.query_params.getlist("field"),
219219
)
220220

221-
if len(response) == 0:
221+
if len(replay_data) == 0:
222222
return Response(status=404)
223223
else:
224-
return Response({"data": response[0]}, status=200)
224+
return Response({"data": replay_data[0]}, status=200)

src/sentry/replays/endpoints/project_replay_details.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ def get(self, request: Request, project: Project, replay_id: str) -> Response:
5959
request_user_id=request.user.id,
6060
)
6161

62-
response = process_raw_response(
62+
replay_data = process_raw_response(
6363
snuba_response,
6464
fields=request.query_params.getlist("field"),
6565
)
6666

67-
if len(response) == 0:
67+
if len(replay_data) == 0:
6868
return Response(status=404)
6969
else:
70-
return Response({"data": response[0]}, status=200)
70+
return Response({"data": replay_data[0]}, status=200)
7171

7272
@extend_schema(
7373
operation_id="Delete a Replay Instance",

src/sentry/replays/endpoints/project_replay_video_details.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,20 @@ def get(self, request: Request, project, replay_id, segment_id) -> HttpResponseB
6767
return self.respond({"detail": "Replay recording segment not found."}, status=404)
6868

6969
if range_header := request.headers.get("Range"):
70-
response = handle_range_response(range_header, video)
70+
video_response = handle_range_response(range_header, video)
7171
else:
7272
video_io = BytesIO(video)
7373
iterator = iter(lambda: video_io.read(4096), b"")
74-
response = StreamingHttpResponse(iterator, content_type="application/octet-stream")
75-
response["Content-Length"] = len(video)
76-
77-
response["Accept-Ranges"] = "bytes"
78-
response["Content-Disposition"] = f'attachment; filename="{make_video_filename(segment)}"'
79-
return response
74+
video_response = StreamingHttpResponse(
75+
iterator, content_type="application/octet-stream"
76+
)
77+
video_response["Content-Length"] = len(video)
78+
79+
video_response["Accept-Ranges"] = "bytes"
80+
video_response["Content-Disposition"] = (
81+
f'attachment; filename="{make_video_filename(segment)}"'
82+
)
83+
return video_response
8084

8185

8286
def handle_range_response(range_header: str, video: bytes) -> HttpResponseBase:

0 commit comments

Comments
 (0)