From ba36050e8d6ccd8de647700888d316282b1abaf3 Mon Sep 17 00:00:00 2001 From: Daniel Gaspar Date: Fri, 13 Oct 2023 12:00:27 +0100 Subject: [PATCH 1/2] fix: old API api column edit --- flask_appbuilder/views.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/flask_appbuilder/views.py b/flask_appbuilder/views.py index c045902e5c..573c4abc7c 100644 --- a/flask_appbuilder/views.py +++ b/flask_appbuilder/views.py @@ -255,9 +255,7 @@ def api_read(self): log.warning("This API is deprecated and will be removed on 2.3.X") # Get arguments for ordering if get_order_args().get(self.__class__.__name__): - order_column, order_direction = get_order_args().get( - self.__class__.__name__ - ) + order_column, order_direction = get_order_args().get(self.__class__.__name__) else: order_column, order_direction = "", "" page = get_page_args().get(self.__class__.__name__) @@ -472,7 +470,7 @@ def api_column_edit(self, col_name): log.warning("This API is deprecated and will be removed on 2.3.X") filter_rel_fields = None if self.edit_form_query_rel_fields: - filter_rel_fields = self.edit_form_query_rel_fields + filter_rel_fields = self.edit_form_query_rel_fields.get(col_name) ret_json = self._get_related_column_data(col_name, filter_rel_fields) response = make_response(ret_json, 200) response.headers["Content-Type"] = "application/json" @@ -486,9 +484,7 @@ def api_readvalues(self): log.warning("This API is deprecated and will be removed on 2.3.X") # Get arguments for ordering if get_order_args().get(self.__class__.__name__): - order_column, order_direction = get_order_args().get( - self.__class__.__name__ - ) + order_column, order_direction = get_order_args().get(self.__class__.__name__) else: order_column, order_direction = "", "" get_filter_args(self._filters) From 0e9fcaa00bbb787fa14a652169ec1f124abf8259 Mon Sep 17 00:00:00 2001 From: Daniel Gaspar Date: Fri, 13 Oct 2023 12:03:08 +0100 Subject: [PATCH 2/2] fix lint --- flask_appbuilder/views.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/flask_appbuilder/views.py b/flask_appbuilder/views.py index 573c4abc7c..8439ea3c5b 100644 --- a/flask_appbuilder/views.py +++ b/flask_appbuilder/views.py @@ -255,7 +255,9 @@ def api_read(self): log.warning("This API is deprecated and will be removed on 2.3.X") # Get arguments for ordering if get_order_args().get(self.__class__.__name__): - order_column, order_direction = get_order_args().get(self.__class__.__name__) + order_column, order_direction = get_order_args().get( + self.__class__.__name__ + ) else: order_column, order_direction = "", "" page = get_page_args().get(self.__class__.__name__) @@ -484,7 +486,9 @@ def api_readvalues(self): log.warning("This API is deprecated and will be removed on 2.3.X") # Get arguments for ordering if get_order_args().get(self.__class__.__name__): - order_column, order_direction = get_order_args().get(self.__class__.__name__) + order_column, order_direction = get_order_args().get( + self.__class__.__name__ + ) else: order_column, order_direction = "", "" get_filter_args(self._filters)