Skip to content

Commit

Permalink
Fix points JSON download
Browse files Browse the repository at this point in the history
No longer open points JSON in a browser tab,
instead download a file.

Fixes #733
  • Loading branch information
ihalaij1 committed Oct 2, 2024
1 parent be5eafb commit 17e7a2c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions exercise/api/csv/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 17e7a2c

Please sign in to comment.