def validate_on_submit(self):
<EOL>valid = FlaskWtf.validate_on_submit(self)<EOL>if not self._schema or not self.is_submitted():<EOL><INDENT>return valid<EOL><DEDENT>data = dict()<EOL>for field in self._fields:<EOL><INDENT>data[field] = self._fields[field].data<EOL><DEDENT>result = self.schema.process(data, context=self._force_context)<EOL>self.set_errors(result)<EOL>for field in data:<EOL><INDENT>self._fields[field].data = data[field]<EOL><DEDENT>return valid and not bool(self.errors)<EOL>
Extend validate on submit to allow validation with schema