Fix importing csv files containing utf8 characters

The csv module on Python 2 doesn't support utf8 (even encoded as bytes), the easiest fix is to use the csv module backported from Python 3.

Fixes #1312

See https://docs.python.org/2/library/csv.html
See https://github.com/ryanhiebert/backports.csv
This commit is contained in:
Andrew Fyfe
2018-01-05 12:47:21 +00:00
parent 71582c57cb
commit 425792d23d
8 changed files with 75 additions and 54 deletions
+7 -7
View File
@@ -366,13 +366,13 @@ class User(AbstractUser):
"""
row = [
"account",
force_str(self.username),
force_str(self.password),
force_str(self.first_name),
force_str(self.last_name),
force_str(self.is_active),
force_str(self.role),
force_str(self.email)
smart_text(self.username),
smart_text(self.password),
smart_text(self.first_name),
smart_text(self.last_name),
smart_text(self.is_active),
smart_text(self.role),
smart_text(self.email)
]
results = signals.account_exported.send(
sender=self.__class__, user=self)