diff --git a/test_server/crm/views.py b/test_server/crm/views.py index d5aef86..d793969 100644 --- a/test_server/crm/views.py +++ b/test_server/crm/views.py @@ -674,8 +674,11 @@ class WxphoneRegister(APIView): request.user.name = data.get('name', '未知') if request.user.role.name =='游客': request.user.role = ConsumerRole.objects.get(name='注册用户') - # if not request.user.workscope: - # request.user.workscope = WorkScope.objects.filter(sortnum=1).order_by('id').first() + if not request.user.workscope: + try: + request.user.workscope = WorkScope.objects.filter(sortnum=0).order_by('id').first() + except: + pass request.user.save() return Response(status=status.HTTP_200_OK, data=ConsumerDetailSerializer(instance=request.user).data)