diff --git a/src/dashboard/apigateway/apigateway/apis/web/plugin/views.py b/src/dashboard/apigateway/apigateway/apis/web/plugin/views.py index a5535f21b..6881daf07 100644 --- a/src/dashboard/apigateway/apigateway/apis/web/plugin/views.py +++ b/src/dashboard/apigateway/apigateway/apis/web/plugin/views.py @@ -334,17 +334,11 @@ def _check_if_changed(self, input_data: Dict[str, Any], instance: PluginConfig) input_yaml = yaml_loads(input_data["yaml"]) current_yaml = yaml_loads(instance.yaml) - if input_yaml != current_yaml: + if input_yaml != current_yaml or input_data["type_id"].id != instance.type.id: return True except Exception: return True - if input_data["name"] != instance.name: - return True - - if input_data["type_id"].id != instance.type.id: - return True - return False def get_queryset(self): diff --git a/src/dashboard/apigateway/apigateway/tests/apis/web/plugin/test_views.py b/src/dashboard/apigateway/apigateway/tests/apis/web/plugin/test_views.py index e834cd02c..4a88c937c 100644 --- a/src/dashboard/apigateway/apigateway/tests/apis/web/plugin/test_views.py +++ b/src/dashboard/apigateway/apigateway/tests/apis/web/plugin/test_views.py @@ -242,14 +242,6 @@ def test_check_if_changed( } assert view._check_if_changed(fake_input_data1, fake_plugin_bk_header_rewrite) - # update name - fake_input_data2 = { - "name": "bk-header-rewrite-2", - "type_id": fake_plugin_check_changed_binding[0], - "yaml": yaml, - } - assert view._check_if_changed(fake_input_data2, fake_plugin_bk_header_rewrite) - # update type_id fake_input_data3 = { "name": fake_plugin_bk_header_rewrite.name,