Skip to content

Commit

Permalink
[#1148] only strip if strippable otherwise just return value
Browse files Browse the repository at this point in the history
  • Loading branch information
joetsoi committed Aug 15, 2013
1 parent 8cf1677 commit 6650a96
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ckan/logic/validators.py
Expand Up @@ -648,4 +648,7 @@ def list_of_strings(key, data, errors, context):
raise Invalid('%s: %s' % (_('Not a string'), x))

def strip_whitespace(value, context):
return value.strip()
try:
return value.strip()
except AttributeError:
return value

0 comments on commit 6650a96

Please sign in to comment.