From 6b8380109e27329a6bdd312615421317a73fd87e Mon Sep 17 00:00:00 2001 From: Manjit Kumar Date: Mon, 27 Jun 2016 10:45:16 +0530 Subject: [PATCH] update validation for CSV of integers (#9) * update validation for CSV of integers * Update validations.py --- filters/validations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/filters/validations.py b/filters/validations.py index 5cb8f95..ecdc051 100644 --- a/filters/validations.py +++ b/filters/validations.py @@ -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: @@ -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)