Browse files

ensure config validation method 'force_list' treats empty strings as …

…empty lists

Previously a list accepting option that was set to an empty string would
generate a list with a single empty-string vaue.  This would cause
confusing errors and require additional checks to work around.

This patch ensures force_list will return an empty list of a value is
a false value. so "option = " is equivalent to "option = ,"
  • Loading branch information...
abg committed Feb 4, 2013
1 parent 6e3333a commit b6acceb341dd32e510e3a753af4cf4ef7dc3120b
Showing with 1 addition and 1 deletion.
  1. +1 −1 holland/core/config/
@@ -1226,7 +1226,7 @@ def force_list(value, min=None, max=None):
if not isinstance(value, (list, tuple)):
- value = [value]
+ value = value and [value] or []
return is_list(value, min, max)

0 comments on commit b6acceb

Please sign in to comment.