Skip to content

Commit 79b89a7

Browse files
committed
Fix empty spaces while validating CSV of integers. (#8)
* Fix empty spaces while validating CSV of integers. * Update setup.py * Update validations.py
1 parent 7f7761e commit 79b89a7

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

filters/validations.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ def fn(value):
103103
try:
104104
if isinstance(value, unicode):
105105
if ',' in value:
106-
value = map(int, filter(bool, value.split(',')))
106+
value = map(
107+
int, filter(
108+
bool, map(
109+
lambda x: x.strip(), value.split(',')
110+
)
111+
)
112+
)
107113
return value
108114
else:
109115
return int(value)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
2020

2121
__name__ = 'drf-url-filters'
22-
__version__ = '0.1.3'
22+
__version__ = '0.1.4'
2323
__author__ = 'Manjit Kumar'
2424
__author_email__ = 'manjit1727@gmail.com'
2525
__url__ = 'https://github.com/manjitkumar/drf-url-filters'

0 commit comments

Comments
 (0)