witten
/
luminotes
Archived
1
0
Fork 0

For none_okay validator flag, allow empty strings as well.

This commit is contained in:
Dan Helfman 2007-07-28 04:11:14 +00:00
parent e963007ae5
commit f81707ea2f
1 changed files with 1 additions and 1 deletions

View File

@ -259,7 +259,7 @@ class Valid_id( object ):
self.__none_okay = none_okay
def __call__( self, value ):
if self.__none_okay and value is None: return None
if self.__none_okay and value in ( None, "" ): return None
if self.ID_PATTERN.search( value ): return str( value )
raise ValueError()