Skip to content

Commit

Permalink
Adaption to modified validator API.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Feb 9, 2013
1 parent 89601fd commit 80c4e65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tw2/forms/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class FileValidator(twc.Validator):
'badext': "File name must have '$extension' extension",
}

def validate_python(self, value, outer_call=None):
def _validate_python(self, value, outer_call=None):
if isinstance(value, cgi.FieldStorage):
if self.required and not getattr(value, 'filename', None):
raise twc.ValidationError('required', self)
Expand Down Expand Up @@ -340,7 +340,7 @@ def _validate(self, value, state=None):
if not isinstance(value, (list, tuple)):
value = [value]
if self.validator:
self.validator.validate_python(self.validator.to_python(value, state))
self.validator.to_python(value, state)
if self.item_validator:
value = [twc.safe_validate(self.item_validator, v) for v in value]
self.value = [v for v in value if v is not twc.Invalid]
Expand Down

0 comments on commit 80c4e65

Please sign in to comment.