Merge remote-tracking branch 'origin/master' into master

This commit is contained in:
xieshen 2020-12-07 12:41:03 +08:00
commit 24f95e2425
1 changed files with 2 additions and 0 deletions

View File

@ -120,6 +120,8 @@ def register_step_one(request):
phone=phone, code=code, category=category).first()
if verify_code and verify_code.is_in_progress():
profile = Userprofile.objects.filter(user__username=phone).first()
if profile.status == 1:
return JsonResponse({'status': 'error', 'message': '账号已激活,不需要重复激活'})
return JsonResponse({'status': 'success', 'message': {'id': profile.user_id, 'phone': phone, 'name': profile.name, 'organization': profile.organization.name}})
else:
return JsonResponse({'status': 'error', 'message': '验证码超时,请重发'})