diff --git a/polls/views/user.py b/polls/views/user.py index 52b9393..e790f50 100644 --- a/polls/views/user.py +++ b/polls/views/user.py @@ -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': '验证码超时,请重发'})