From 17e7a2c651f8137307fe96239d18d46f3d5511e3 Mon Sep 17 00:00:00 2001 From: Jimmy Ihalainen Date: Wed, 2 Oct 2024 11:33:51 +0300 Subject: [PATCH] Fix points JSON download No longer open points JSON in a browser tab, instead download a file. Fixes #733 --- exercise/api/csv/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exercise/api/csv/views.py b/exercise/api/csv/views.py index 1b47037e1..6d6dd5eba 100644 --- a/exercise/api/csv/views.py +++ b/exercise/api/csv/views.py @@ -158,6 +158,8 @@ def submitted_field(submission, name): response = Response(data) if isinstance(getattr(request, 'accepted_renderer'), CSVRenderer): response['Content-Disposition'] = 'attachment; filename="submissions.csv"' + else: + response['Content-Disposition'] = 'attachment; filename="submissions.json"' return response def get_renderer_context(self):