feat: update medical training case and auth modules
This commit is contained in:
@@ -44,7 +44,8 @@ def send_code(request):
|
||||
user_exists = User.objects.filter(phone=phone).exists()
|
||||
if scene == 'register' and user_exists:
|
||||
raise AppError('AUTH_PHONE_REGISTERED', '该手机号已注册')
|
||||
if scene in ('login', 'reset') and not user_exists:
|
||||
# scene='login':不检查是否已注册(未注册用户通过 login-code 自动注册)
|
||||
if scene == 'reset' and not user_exists:
|
||||
raise AppError('AUTH_PHONE_NOT_FOUND', '手机号未注册')
|
||||
|
||||
code = generate_sms_code()
|
||||
|
||||
Reference in New Issue
Block a user