From 3df411fd610d02967694d985d359416b26261983 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 21 Feb 2023 13:47:47 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E6=9D=83=E9=99=90?= =?UTF-8?q?=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/accounts/api/account/task.py | 7 ++++++- apps/locale/ja/LC_MESSAGES/django.mo | 4 ++-- apps/locale/zh/LC_MESSAGES/django.mo | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/accounts/api/account/task.py b/apps/accounts/api/account/task.py index 85a3831e2..050e69052 100644 --- a/apps/accounts/api/account/task.py +++ b/apps/accounts/api/account/task.py @@ -13,7 +13,12 @@ class AccountsTaskCreateAPI(CreateAPIView): serializer_class = serializers.AccountTaskSerializer def check_permissions(self, request): - return request.user.has_perm('assets.test_assetconnectivity') + act = request.data.get('action') + if act == 'push': + code = 'accounts.push_account' + else: + code = 'accounts.verify_account' + return request.user.has_perm(code) def perform_create(self, serializer): data = serializer.validated_data diff --git a/apps/locale/ja/LC_MESSAGES/django.mo b/apps/locale/ja/LC_MESSAGES/django.mo index f2bf6d5da..9380816b8 100644 --- a/apps/locale/ja/LC_MESSAGES/django.mo +++ b/apps/locale/ja/LC_MESSAGES/django.mo @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ad88d17921655f6102ae29c8f1e34c65eac8eb5217a8ba14d189035db156789a -size 135647 +oid sha256:014483808a830a01f5432fdc44bc34f7f392e53a160ffa97eb377dbb49e0ec9a +size 135547 diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index 1da0d3cf9..70960ba2c 100644 --- a/apps/locale/zh/LC_MESSAGES/django.mo +++ b/apps/locale/zh/LC_MESSAGES/django.mo @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e044950aeb211a81af9d2530f0468b5aa0ffc3acfffd899fbacb78a769b5de59 -size 111504 +oid sha256:1c1524b6173a2613845d9450d84ef8ca9cf1be6d0f7cdae2a89f6131d6abc1f1 +size 111449