Changeset 4192

Show
Ignore:
Timestamp:
03/02/08 03:56:57 (6 months ago)
Author:
faide
Message:

Fix breakeage, because the FileStorage? validator was returning a filename instead of the cgi.FieldStorage? instance that would provide the open file and all the other attributes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/turbogears/validators.py

    r4183 r4192  
    147147    def _to_python(self, value, state=None): 
    148148        try: 
    149             value = value.filename 
     149            fname = value.filename 
    150150        except AttributeError: 
    151151            value = None 
    152         if not value and self.not_empty: 
     152 
     153        if not fname and self.not_empty: 
    153154            raise Invalid(self.message('notEmpty', state), value, state) 
     155 
    154156        return value 
    155157