From 5e90ae3a46237c69b9ca5a4d782fa23abb05ccf5 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 12 Apr 2021 22:10:02 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E7=B1=BB=E5=88=AB=E6=98=AF?= =?UTF-8?q?=E9=9D=9E=E5=8C=BB=E5=AD=A6=E2=85=A2=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_server/crm/views.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test_server/crm/views.py b/test_server/crm/views.py index aa2a866..467e4a4 100644 --- a/test_server/crm/views.py +++ b/test_server/crm/views.py @@ -607,6 +607,12 @@ class ConsumerRegister(APIView): consumer.nickname = nickname if consumer.role and consumer.role.name == '游客': consumer.role = ConsumerRole.objects.get(name='注册用户') + # 默认工作类别是非医学Ⅲ类 + if not consumer.workscope: + try: + consumer.workscope = WorkScope.objects.get(name='非医学Ⅲ类') + except: + pass consumer.save() return Response(status=status.HTTP_200_OK) else: @@ -617,6 +623,12 @@ class ConsumerRegister(APIView): consumer.nickname = nickname if consumer.role and consumer.role.name == '游客': consumer.role = ConsumerRole.objects.get(name='注册用户') + # 默认工作类别是非医学Ⅲ类 + if not consumer.workscope: + try: + consumer.workscope = WorkScope.objects.get(name='非医学Ⅲ类') + except: + pass consumer.save() return Response(status=status.HTTP_200_OK) else: