Skip to content

Commit

Permalink
Merge pull request #118 from longguikeji/sy/fix_alipay_serializer
Browse files Browse the repository at this point in the history
fix(config):alipay_config_serializer
  • Loading branch information
skoogi authored Feb 25, 2020
2 parents 0de7c5e + e23535d commit 17b3486
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions siteapi/v1/serializers/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion test/tests/test_normal_user_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 17b3486

Please sign in to comment.