Small changes
This commit is contained in:
@@ -71,7 +71,14 @@ def account_verify_phone(params):
|
||||
code = api_get_param_int(params, "code", False, None)
|
||||
|
||||
if code is None:
|
||||
PhoneVerificationService.send_verify(user.phone)
|
||||
res, err_code = PhoneVerificationService.send_verify(user.phone)
|
||||
|
||||
if not res:
|
||||
if err_code in API_ERROR_VALIDATION:
|
||||
raise Exception(API_ERROR_VALIDATION[err_code])
|
||||
else:
|
||||
raise Exception(API_ERROR_VALIDATION_UNKNOWN)
|
||||
|
||||
return api_make_response({"action": "phone_call"})
|
||||
else:
|
||||
res, err_code = PhoneVerificationService.check_code(user.phone, code)
|
||||
@@ -79,7 +86,7 @@ def account_verify_phone(params):
|
||||
if res:
|
||||
user.is_phone_verified = True
|
||||
user.save()
|
||||
return api_make_response({"status": "success"})
|
||||
return api_make_response({})
|
||||
else:
|
||||
if err_code in API_ERROR_VALIDATION:
|
||||
raise Exception(API_ERROR_VALIDATION[err_code])
|
||||
|
||||
Reference in New Issue
Block a user