Updated AJAX forms errors management
authorThierry Florac <thierry.florac@onf.fr>
Wed, 23 May 2018 15:06:41 +0200
changeset 106 2dbbb022d2e8
parent 105 2a73976299b3
child 107 fec6b5f9601e
Updated AJAX forms errors management
src/pyams_form/form.py
--- a/src/pyams_form/form.py	Fri May 18 15:55:52 2018 +0200
+++ b/src/pyams_form/form.py	Wed May 23 15:06:41 2018 +0200
@@ -390,7 +390,7 @@
             data[form] = form_data
             errors = errors + form_errors
         if errors or self.errors:
-            return self.get_ajax_errors()
+            return self.get_ajax_errors(errors)
         try:
             result = self.createAndAdd(data)
         except ValidationError as error:
@@ -505,7 +505,7 @@
             data[form] = form_data
             errors = errors + form_errors
         if errors or self.errors:
-            return self.get_ajax_errors()
+            return self.get_ajax_errors(errors)
         # update form content
         translate = self.request.localizer.translate
         try: