From 35883e4c97370be5f6cc10bd30723ebb80a4b7bc Mon Sep 17 00:00:00 2001 From: winfun Date: Mon, 24 Feb 2020 17:20:23 +0800 Subject: [PATCH 1/2] fix(config):alipay_config_serializer --- siteapi/v1/serializers/config.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/siteapi/v1/serializers/config.py b/siteapi/v1/serializers/config.py index 253669a1a..5b8b0fb86 100644 --- a/siteapi/v1/serializers/config.py +++ b/siteapi/v1/serializers/config.py @@ -280,9 +280,10 @@ def update(self, instance, validated_data): # pylint: disable=too-many-locals alipay_config_data = validated_data.pop('alipay_config', None) if alipay_config_data: - serializer = AlipayConfigSerializer(AlipayConfig.get_current(), alipay_config_data, partial=True) - serializer.is_valid(raise_exception=True) - serializer.save() + if alipay_config_data["app_id"] != '': + serializer = AlipayConfigSerializer(AlipayConfig.get_current(), alipay_config_data, partial=True) + serializer.is_valid(raise_exception=True) + serializer.save() qq_config_data = validated_data.pop('qq_config', None) if qq_config_data: From e23535dc34ba275cf8d00bf9528394a1761c47eb Mon Sep 17 00:00:00 2001 From: winfun Date: Tue, 25 Feb 2020 11:32:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(config):=E6=B5=8B=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=9D=83=E9=99=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/tests/test_normal_user_view.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tests/test_normal_user_view.py b/test/tests/test_normal_user_view.py index fb3506ace..e27c02276 100644 --- a/test/tests/test_normal_user_view.py +++ b/test/tests/test_normal_user_view.py @@ -40,7 +40,7 @@ def app_black_list(self): ''' 黑名单:部门一成员13899990006为黑名单人员,不可见应用十 ''' - user = User.objects.filter(username='13899990006') + user = User.objects.filter(username='13899990006').first() client = self.login_as(user) res = client.get(reverse('siteapi:ucenter_app_list')) self.assertEqual(res.json()['count'], 0)