fix: 用户创建 500

pull/6700/head
xinwen 3 years ago committed by 老广
parent 98e38ebfd8
commit 10c2935df4

@ -127,7 +127,7 @@ class UserSerializer(CommonBulkSerializerMixin, serializers.ModelSerializer):
def validate_password(self, password): def validate_password(self, password):
from ..utils import check_password_rules from ..utils import check_password_rules
password_strategy = self.initial_data.get('password_strategy') 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 return
if self.instance and not password: if self.instance and not password:

Loading…
Cancel
Save