From 61ee92e6fddb498384a0571e6ee1994811f37e9f Mon Sep 17 00:00:00 2001 From: F-cq <2036478450@qq.com> Date: Mon, 11 Nov 2024 16:20:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(apis/web/resource/view):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=B5=84=E6=BA=90=E7=BB=91=E5=AE=9A=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E6=9C=AA=E4=BF=AE=E6=94=B9=E4=BD=86=E8=A7=A6=E5=8F=91=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apigateway/apigateway/apis/web/plugin/views.py | 8 +------- .../apigateway/tests/apis/web/plugin/test_views.py | 8 -------- 2 files changed, 1 insertion(+), 15 deletions(-) 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,