fix: 注册用户不给工作类别

This commit is contained in:
caoqianming 2023-05-16 10:55:28 +08:00
parent 57bb0e55eb
commit a5f4a10fca
1 changed files with 2 additions and 2 deletions

View File

@ -674,8 +674,8 @@ 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:
# request.user.workscope = WorkScope.objects.filter(sortnum=1).order_by('id').first()
request.user.save()
return Response(status=status.HTTP_200_OK, data=ConsumerDetailSerializer(instance=request.user).data)