Check parent of "get_ajax_output" method
authorThierry Florac <thierry.florac@onf.fr>
Fri, 08 Jun 2018 14:51:03 +0200
changeset 110 303800c113f2
parent 109 48697c7b632c
child 111 2e43c617c3f1
Check parent of "get_ajax_output" method
src/pyams_form/form.py
--- a/src/pyams_form/form.py	Fri Jun 08 10:52:49 2018 +0200
+++ b/src/pyams_form/form.py	Fri Jun 08 14:51:03 2018 +0200
@@ -723,7 +723,7 @@
             new_class = type('AJAX' + ob.__name__, (base, ob), cdict)
             try:
                 # check if current form is overriding "get_ajax_output" method
-                if ob.get_ajax_output.__qualname__.startswith(ob.__name__ + '.'):  # redefined method
+                if not ob.get_ajax_output.__qualname__.startswith('AJAXForm.'):  # redefined method
                     new_class.get_ajax_output = ob.get_ajax_output
             except AttributeError:
                 pass