From a22f36a06a3af7fdfce9871603bd13c6201a68d7 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 27 Jun 2023 14:31:20 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=8E=BB=E6=8E=89=20debug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/accounts/const/account.py | 2 +- apps/authentication/models/connection_token.py | 3 ++- apps/locale/ja/LC_MESSAGES/django.mo | 4 ++-- apps/locale/ja/LC_MESSAGES/django.po | 2 +- apps/locale/zh/LC_MESSAGES/django.mo | 4 ++-- apps/locale/zh/LC_MESSAGES/django.po | 2 +- apps/perms/utils/account.py | 1 - 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/accounts/const/account.py b/apps/accounts/const/account.py index c57520db7..10a681969 100644 --- a/apps/accounts/const/account.py +++ b/apps/accounts/const/account.py @@ -13,7 +13,7 @@ class AliasAccount(TextChoices): ALL = '@ALL', _('All') INPUT = '@INPUT', _('Manual input') USER = '@USER', _('Dynamic user') - ANON = '@ANON', _('Anonymous user') + ANON = '@ANON', _('Anonymous account') class Source(TextChoices): diff --git a/apps/authentication/models/connection_token.py b/apps/authentication/models/connection_token.py index 340d275e4..503489b90 100644 --- a/apps/authentication/models/connection_token.py +++ b/apps/authentication/models/connection_token.py @@ -9,6 +9,7 @@ from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from rest_framework.exceptions import PermissionDenied +from accounts.const import AliasAccount from assets.const import Protocol from assets.const.host import GATEWAY_NAME from common.db.fields import EncryptTextField @@ -209,7 +210,7 @@ class ConnectionToken(JMSOrgBaseModel): if not self.asset: return None - if self.account == '@ANON' and self.asset.category not in ['web', 'custom']: + if self.account == AliasAccount.ANON and self.asset.category not in ['web', 'custom']: raise JMSException({'error': 'Anonymous account is not supported in {}'.format(self.asset.category)}) if self.account.startswith('@'): diff --git a/apps/locale/ja/LC_MESSAGES/django.mo b/apps/locale/ja/LC_MESSAGES/django.mo index ae0b7facf..809f19e6d 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:36918c53144eaae27cb3b68d47882f6ca9b75669862f28f611fb737f6ca39631 -size 145810 +oid sha256:2e28e9c4ff5d91a24d0c176a134f913de93f4a9bd3e9c8fd7aeacaf875a242d5 +size 145813 diff --git a/apps/locale/ja/LC_MESSAGES/django.po b/apps/locale/ja/LC_MESSAGES/django.po index 7a86fc588..979bd2005 100644 --- a/apps/locale/ja/LC_MESSAGES/django.po +++ b/apps/locale/ja/LC_MESSAGES/django.po @@ -63,7 +63,7 @@ msgid "Dynamic user" msgstr "動的コード" #: accounts/const/account.py:16 -msgid "Anonymous user" +msgid "Anonymous account" msgstr "匿名ユーザー" #: accounts/const/account.py:20 users/models/user.py:699 diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index 47f90fa82..131e221ae 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:1f4301cf32731559d2e5ce41c2ab00e4655931914d8ce36bde4ad831cc5ee3f9 -size 119305 +oid sha256:092b15ed84725ceb974bd46407e3d247e6ff9d0505b6044f18c122bf6da1b7f6 +size 119308 diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index 6b10f0926..084f49564 100644 --- a/apps/locale/zh/LC_MESSAGES/django.po +++ b/apps/locale/zh/LC_MESSAGES/django.po @@ -62,7 +62,7 @@ msgid "Dynamic user" msgstr "同名账号" #: accounts/const/account.py:16 -msgid "Anonymous user" +msgid "Anonymous account" msgstr "匿名用户" #: accounts/const/account.py:20 users/models/user.py:699 diff --git a/apps/perms/utils/account.py b/apps/perms/utils/account.py index 73534afc8..62c7b68d0 100644 --- a/apps/perms/utils/account.py +++ b/apps/perms/utils/account.py @@ -81,5 +81,4 @@ class PermAccountUtil(AssetPermissionUtil): account.actions = action_bit account.date_expired = max(cleaned_accounts_expired[account]) accounts.append(account) - print("Accounts: ", accounts) return accounts