Skip to content

Commit

Permalink
fix for the wrong download of the testcase file (always input)
Browse files Browse the repository at this point in the history
  • Loading branch information
ooemperor committed Mar 17, 2024
1 parent a7aa4e6 commit ea029c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions codeGrader/frontend/admin/handlers/TestCase.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ def get(self, id_: int) -> Union[str, Response]:
task_id = testcase["task"]["profile"]["id"]

if self.admin.check_permission('r', task_profile_id): # when admin is allowed to view this File
input_file_id = testcase["input_file_id"]
file_id = testcase[self.file_id_name]

req = self.api.get_file(f"/file/{input_file_id}")
req = self.api.get_file(f"/file/{file_id}")
filename = testcase[self.file_type_name]["filename"]
req.headers['Content-Disposition'] = f"attachment;filename={filename}"
return Response(stream_with_context(req.iter_content(chunk_size=2048)),
Expand Down

0 comments on commit ea029c7

Please sign in to comment.