fix: 修复忘记密码不包含左侧 + 字符

pull/11278/head
Bai 1 year ago committed by Bryan
parent c11ba16e4e
commit a6e49b730b

@ -52,7 +52,11 @@ class UserResetPasswordSendCodeApi(CreateAPIView):
other_args = {}
target = serializer.validated_data[form_type]
query_key = 'phone' if form_type == 'sms' else form_type
if form_type == 'sms':
query_key = 'phone'
target = target.lstrip('+')
else:
query_key = form_type
user, err = self.is_valid_user(username=username, **{query_key: target})
if not user:
return Response({'error': err}, status=400)

Loading…
Cancel
Save