Skip to content

Commit

Permalink
Fix empty spaces while validating CSV of integers. (#8)
Browse files Browse the repository at this point in the history
* Fix empty spaces while validating CSV of integers.

* Update setup.py

* Update validations.py
  • Loading branch information
manjitkumar committed May 17, 2016
1 parent 7f7761e commit 79b89a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion filters/validations.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@ def fn(value):
try:
if isinstance(value, unicode):
if ',' in value:
value = map(int, filter(bool, value.split(',')))
value = map(
int, filter(
bool, map(
lambda x: x.strip(), value.split(',')
)
)
)
return value
else:
return int(value)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))

__name__ = 'drf-url-filters'
__version__ = '0.1.3'
__version__ = '0.1.4'
__author__ = 'Manjit Kumar'
__author_email__ = 'manjit1727@gmail.com'
__url__ = 'https://github.com/manjitkumar/drf-url-filters'
Expand Down

0 comments on commit 79b89a7

Please sign in to comment.