Browse Source

perf: 修改 i18n

pull/9397/head
ibuler 2 years ago
parent
commit
853f9c422d
  1. 2
      apps/assets/serializers/asset/common.py
  2. 2
      apps/locale/zh/LC_MESSAGES/django.po
  3. 13
      apps/users/serializers/user.py

2
apps/assets/serializers/asset/common.py

@ -6,7 +6,7 @@ from django.db.transaction import atomic
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from accounts.models import Account, AccountTemplate
from accounts.models import Account
from accounts.serializers import AccountSerializerCreateValidateMixin
from common.serializers import WritableNestedModelSerializer, SecretReadableMixin, CommonModelSerializer
from common.serializers.fields import LabeledChoiceField

2
apps/locale/zh/LC_MESSAGES/django.po

@ -6381,7 +6381,7 @@ msgstr "登录被阻塞"
#: users/serializers/user.py:93
msgid "Can public key authentication"
msgstr "能否公钥认证"
msgstr "公钥认证"
#: users/serializers/user.py:162
msgid "Avatar url"

13
apps/users/serializers/user.py

@ -96,11 +96,8 @@ class UserSerializer(RolesSerializerMixin, CommonBulkSerializerMixin, serializer
read_only=True
)
password = EncryptedField(
label=_("Password"),
required=False,
allow_blank=True,
allow_null=True,
max_length=1024,
label=_("Password"), required=False, allow_blank=True,
allow_null=True, max_length=1024,
)
custom_m2m_fields = {
"system_roles": [BuiltinRole.system_user],
@ -129,10 +126,8 @@ class UserSerializer(RolesSerializerMixin, CommonBulkSerializerMixin, serializer
]
# 包含不太常用的字段,可以没有
fields_verbose = fields_small + [
"mfa_force_enabled",
"is_first_login",
"date_password_last_updated",
"avatar_url",
"mfa_force_enabled", "is_first_login",
"date_password_last_updated", "avatar_url",
]
# 外键的字段
fields_fk = []

Loading…
Cancel
Save