Commit c9727a2b by reciproco

Fix CRI-57 Bug

Fix error in instructor dashboard, data download section, when trying to download a csv with the issued certificates in a spanish (es-419) configured edx-platform deployment returns a UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 16: ordinal not in range(128)
parent 5496ec2a
...@@ -24,7 +24,9 @@ def create_csv_response(filename, header, datarows): ...@@ -24,7 +24,9 @@ def create_csv_response(filename, header, datarows):
quotechar='"', quotechar='"',
quoting=csv.QUOTE_ALL) quoting=csv.QUOTE_ALL)
csvwriter.writerow(header) encoded_header = [unicode(s).encode('utf-8') for s in header]
csvwriter.writerow(encoded_header)
for datarow in datarows: for datarow in datarows:
encoded_row = [unicode(s).encode('utf-8') for s in datarow] encoded_row = [unicode(s).encode('utf-8') for s in datarow]
csvwriter.writerow(encoded_row) csvwriter.writerow(encoded_row)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment