Skip to content

Commit

Permalink
Fix to write unicode data on CSV
Browse files Browse the repository at this point in the history
  • Loading branch information
ziafazal committed Jan 17, 2019
1 parent 00a70f3 commit 4e6984e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion freshgrad_test/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def export_as_csv(self, request, queryset):
for obj in queryset:
model_field_data = [getattr(obj, field) for field in model_field_names]
addl_field_data = [obj.user.email, obj.user.profile.name]
writer.writerow(addl_field_data + model_field_data)
writer.writerow([data.encode("utf-8") for data in addl_field_data + model_field_data])

return response

Expand Down

0 comments on commit 4e6984e

Please sign in to comment.