Skip to content

Commit

Permalink
Fix special character support for application submission CSV export
Browse files Browse the repository at this point in the history
  • Loading branch information
julianweng committed Jan 30, 2025
1 parent 8d0adca commit af5e57c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/clubs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6909,7 +6909,7 @@ def list(self, *args, **kwargs):

return Response(data)

@method_decorator(cache_page(60 * 60 * 2))
# @method_decorator(cache_page(60 * 60 * 2))
@action(detail=False, methods=["get"])
def export(self, *args, **kwargs):
"""
Expand Down Expand Up @@ -6954,10 +6954,10 @@ def export(self, *args, **kwargs):
)
df = pd.DataFrame(ApplicationSubmissionCSVSerializer(data, many=True).data)
resp = HttpResponse(
content_type="text/csv",
content_type="text/csv; charset=utf-8-sig", # support special chars
headers={"Content-Disposition": "attachment;filename=submissions.csv"},
)
df.to_csv(index=True, path_or_buf=resp)
df.to_csv(index=True, path_or_buf=resp, encoding="utf-8-sig")

Check warning on line 6960 in backend/clubs/views.py

View check run for this annotation

Codecov / codecov/patch

backend/clubs/views.py#L6960

Added line #L6960 was not covered by tests
return resp

@action(detail=False, methods=["get"])
Expand Down

0 comments on commit af5e57c

Please sign in to comment.