Skip to content

Commit

Permalink
FIXED: csv serializer escaping of quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Bredehöft committed Jul 8, 2015
1 parent 703924a commit b7a7274
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drf_tools/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def deserialize(file_bytes):
@staticmethod
def __validate_cell(cell):
cell = str(cell) if cell is not None else ''
if "\t" in cell or "\n" in cell:
if "\t" in cell or "\n" in cell or '"' in cell:
cell = cell.replace('"', '""')
cell = '"{}"'.format(cell)
return cell

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='drf-tools',
version="0.9.11",
version="0.9.12",
url='https://github.com/seebass/drf-tools',
license='MIT',
description='Multiple extensions and test utilities for Django REST Framework 3',
Expand Down

0 comments on commit b7a7274

Please sign in to comment.