Updated AJAX form decorator
authorThierry Florac <thierry.florac@onf.fr>
Tue, 09 Oct 2018 14:16:16 +0200
changeset 150 f78d1b46e03c
parent 149 d26223a00c51
child 151 68601c3a38a6
Updated AJAX form decorator
src/pyams_form/form.py
--- a/src/pyams_form/form.py	Tue Oct 09 11:48:27 2018 +0200
+++ b/src/pyams_form/form.py	Tue Oct 09 14:16:16 2018 +0200
@@ -732,7 +732,9 @@
                     base_ajax_parent, _ = base.get_ajax_output.__qualname__.split('.')
                     if (ob_ajax_parent != base_ajax_parent) and \
                        (ob_ajax_parent in ('AJAXForm', 'AJAXAddForm', 'AJAXEditForm')):
-                            new_class.get_ajax_output = base.get_ajax_output
+                        new_class.get_ajax_output = base.get_ajax_output
+                    else:
+                        new_class.get_ajax_output = ob.get_ajax_output
                 else:
                     base_ajax_parent, _ = ob.get_ajax_output.__qualname__.split('.')
                     if base_ajax_parent not in ('AJAXForm', 'AJAXAddForm', 'AJAXEditForm'):  # overriden method