Commits

Moriyoshi Koizumi committed 7160dfb Draft

pre_validate() must use a coereced value in comparison for consistency with iter_choices().

  • Participants
  • Parent commits a5f9e30

Comments (0)

Files changed (1)

File wtforms/fields/core.py

 
     def pre_validate(self, form):
         for v, _ in self.choices:
-            if self.data == v:
+            if self.data == self.coerce(v):
                 break
         else:
             raise ValueError(self.gettext('Not a valid choice'))