diff --git a/apps/users/serializers/user.py b/apps/users/serializers/user.py index a9d55375d..d4abf8d34 100644 --- a/apps/users/serializers/user.py +++ b/apps/users/serializers/user.py @@ -127,7 +127,7 @@ class UserSerializer(CommonBulkSerializerMixin, serializers.ModelSerializer): def validate_password(self, password): from ..utils import check_password_rules password_strategy = self.initial_data.get('password_strategy') - if self.instance is None and password_strategy != self.PasswordStrategy.custom: + if self.instance is None and password_strategy != PasswordStrategy.custom: # 创建用户,使用邮件设置密码 return if self.instance and not password: