Commits

danjac  committed a7f1dc6

return errors in correct order

  • Participants
  • Parent commits 512d875

Comments (0)

Files changed (2)

File pyramid_simpleform/form.py

         """
         Returns all errors in a single list.
         """
-        return self.errors.values()
+        errors = []
+        for node in self.schema:
+            errors += self.errors_for(node.name)
+        return errors
 
     def errors_for(self, field):
         """

File pyramid_simpleform/tests.py

         form.errors = {"name" : u"Name is missing",
                        "value" : u"Value is missing"}
         self.assert_(form.all_errors() == [
-            u"Name is missing", 
-            u"Value is missing"])
+            u"Name is missing"])
 
     def test_errors_for(self):
         from pyramid_simpleform.form import Form