Skip to content

Commit 6b83801

Browse files
authored
update validation for CSV of integers (#9)
* update validation for CSV of integers * Update validations.py
1 parent 79b89a7 commit 6b83801

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

filters/validations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ def fn(value):
9696
def CSVofIntegers(msg=None):
9797
'''
9898
Checks whether a value is list of integers.
99-
Returns list of integers or just an integer
100-
if there is only one element in list.
99+
Returns list of integers or just one integer in
100+
list if there is only one element in given CSV string.
101101
'''
102102
def fn(value):
103103
try:
@@ -112,7 +112,7 @@ def fn(value):
112112
)
113113
return value
114114
else:
115-
return int(value)
115+
return [int(value)]
116116
except ValueError:
117117
raise Invalid(
118118
'<{0}> is not a valid csv of integers'.format(value)

0 commit comments

Comments
 (0)