Skip to content

Commit

Permalink
update validation for CSV of integers (#9)
Browse files Browse the repository at this point in the history
* update validation for CSV of integers

* Update validations.py
  • Loading branch information
manjitkumar authored Jun 27, 2016
1 parent 79b89a7 commit 6b83801
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions filters/validations.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def fn(value):
def CSVofIntegers(msg=None):
'''
Checks whether a value is list of integers.
Returns list of integers or just an integer
if there is only one element in list.
Returns list of integers or just one integer in
list if there is only one element in given CSV string.
'''
def fn(value):
try:
Expand All @@ -112,7 +112,7 @@ def fn(value):
)
return value
else:
return int(value)
return [int(value)]
except ValueError:
raise Invalid(
'<{0}> is not a valid csv of integers'.format(value)
Expand Down

0 comments on commit 6b83801

Please sign in to comment.