From 0828a0e9bad206ce668d4c74180e1755966c89cf Mon Sep 17 00:00:00 2001 From: Bai Date: Wed, 15 Feb 2023 14:48:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E6=8E=88=E6=9D=83=E7=94=A8=E6=88=B7=E6=8E=88?= =?UTF-8?q?=E6=9D=83=E8=A7=84=E5=88=99=E5=88=97=E8=A1=A8=E7=9A=84=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/locale/ja/LC_MESSAGES/django.mo | 4 ++-- apps/locale/zh/LC_MESSAGES/django.mo | 4 ++-- apps/locale/zh/LC_MESSAGES/django.po | 2 +- apps/perms/filters.py | 1 + apps/perms/models/asset_permission.py | 2 +- apps/perms/serializers/permission.py | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/apps/locale/ja/LC_MESSAGES/django.mo b/apps/locale/ja/LC_MESSAGES/django.mo index 8fef7cefd..7806fbaae 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:441239d12ee3ba50b36b3e5b31246993601414d4d119c2c784e56b54208a5a96 -size 135089 +oid sha256:01857f512b7280cc7db6be734dc3aa266f6384b222addca127eabbe61de47bb2 +size 135229 diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index 025f8860b..93beea395 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:bef1d490ea8a2c381a929d8c214e6be9126efcacc98bc0ea09344bef46369d9e -size 111567 +oid sha256:037f861dc9c6f7ea80ce09276e0eb417b60292fac4d7dcca02f661a53688e6e9 +size 111627 diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index 4f3247166..61ce597fa 100644 --- a/apps/locale/zh/LC_MESSAGES/django.po +++ b/apps/locale/zh/LC_MESSAGES/django.po @@ -2480,7 +2480,7 @@ msgstr "{} 不能为空" #: authentication/serializers/token.py:79 perms/serializers/permission.py:30 #: perms/serializers/permission.py:62 users/serializers/user.py:160 msgid "Is valid" -msgstr "账号是否有效" +msgstr "是否有效" #: authentication/tasks.py:12 msgid "Clean expired session" diff --git a/apps/perms/filters.py b/apps/perms/filters.py index df6a4e7d1..d585d8382 100644 --- a/apps/perms/filters.py +++ b/apps/perms/filters.py @@ -1,4 +1,5 @@ from django_filters import rest_framework as filters +from django.utils.translation import ugettext_lazy as _ from django.db.models import QuerySet, Q from common.drf.filters import BaseFilterSet diff --git a/apps/perms/models/asset_permission.py b/apps/perms/models/asset_permission.py index 232df9162..c17a67acb 100644 --- a/apps/perms/models/asset_permission.py +++ b/apps/perms/models/asset_permission.py @@ -67,7 +67,7 @@ class AssetPermission(JMSOrgBaseModel): 'assets.Node', related_name='granted_by_permissions', blank=True, verbose_name=_("Nodes") ) # 特殊的账号: @ALL, @INPUT @USER 默认包含,将来在全局设置中进行控制. - accounts = models.JSONField(default=list, verbose_name=_("Accounts")) + accounts = models.JSONField(default=list, verbose_name=_("Account")) actions = models.IntegerField(default=ActionChoices.connect, verbose_name=_("Actions")) date_start = models.DateTimeField(default=timezone.now, db_index=True, verbose_name=_("Date start")) date_expired = models.DateTimeField( diff --git a/apps/perms/serializers/permission.py b/apps/perms/serializers/permission.py index 39d64f8d1..85799f011 100644 --- a/apps/perms/serializers/permission.py +++ b/apps/perms/serializers/permission.py @@ -29,7 +29,7 @@ class AssetPermissionSerializer(BulkOrgResourceModelSerializer): actions = ActionChoicesField(required=False, allow_null=True, label=_("Actions")) is_valid = serializers.BooleanField(read_only=True, label=_("Is valid")) is_expired = serializers.BooleanField(read_only=True, label=_("Is expired")) - accounts = serializers.ListField(label=_("Accounts"), required=False) + accounts = serializers.ListField(label=_("Account"), required=False) class Meta: model = AssetPermission