Skip to content

Commit

Permalink
minor: resolve #1232 conversations
Browse files Browse the repository at this point in the history
  • Loading branch information
narasux committed Sep 13, 2023
1 parent 62aec4a commit 34e7335
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/bk-user/bkuser/apis/web/tenant/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TenantFeatureFlagSLZ(serializers.Serializer):
class TenantManagerPasswordInitialConfigSLZ(serializers.Serializer):
force_change_at_first_login = serializers.BooleanField(help_text="首次登录后强制修改密码", default=True)
cannot_use_previous_password = serializers.BooleanField(help_text="修改密码时候不能使用之前的密码", default=True)
reserved_previous_password_count = serializers.BooleanField(
reserved_previous_password_count = serializers.IntegerField(
help_text="之前的 N 个密码不能被本次修改使用",
default=3,
)
Expand All @@ -77,7 +77,7 @@ def validate_notification(self, notification: Dict[str, Any]) -> Dict[str, Any]:
try:
NotificationConfig(**notification)
except PDValidationError as e:
raise ValidationError(stringify_pydantic_error(e))
raise ValidationError(_("通知配置不合法:{}").format(stringify_pydantic_error(e)))

return notification

Expand Down
2 changes: 1 addition & 1 deletion src/bk-user/bkuser/apps/data_source/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from blue_krill.data_types.enum import EnumField, StructuredEnum
from django.utils.translation import gettext_lazy as _

DATA_SOURCE_USERNAME_REGEX = re.compile(r"^[a-zA-Z][a-zA-Z0-9._-]{2,31}")
DATA_SOURCE_USERNAME_REGEX = re.compile(r"^[a-zA-Z0-9][a-zA-Z0-9._-]{2,31}")


class DataSourceStatus(str, StructuredEnum):
Expand Down
2 changes: 1 addition & 1 deletion src/bk-user/bkuser/biz/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
def validate_data_source_user_username(value):
if not re.fullmatch(DATA_SOURCE_USERNAME_REGEX, value):
raise ValidationError(
_("{} 不符合 用户名 的命名规范: 由3-32位字母、数字、下划线(_)、点(.)、连接符(-)字符组成,以字母开头").format(value), # noqa: E501
_("{} 不符合 用户名 的命名规范: 由3-32位字母、数字、下划线(_)、点(.)、连接符(-)字符组成,以字母或数字开头").format(value), # noqa: E501
)

0 comments on commit 34e7335

Please sign in to comment.