Updated error handling in AJAX form
authorThierry Florac <thierry.florac@onf.fr>
Fri, 26 Jan 2018 17:27:06 +0100
changeset 79 028af0bbc5f4
parent 78 1e9abe10474b
child 80 e8012944d550
Updated error handling in AJAX form
src/pyams_form/form.py
--- a/src/pyams_form/form.py	Fri Jan 26 17:26:25 2018 +0100
+++ b/src/pyams_form/form.py	Fri Jan 26 17:27:06 2018 +0100
@@ -470,7 +470,7 @@
         except ValidationError as error:
             # This error can occur with file-type inputs
             registry = self.request.registry
-            widget = self.widgets[error.args[-1]]
+            widget = form.widgets[error.args[-1]]
             view = registry.getMultiAdapter((error, self.request, widget, widget.field, self, self.context),
                                             IErrorViewSnippet)
             view.update()