From 3f1b970fa98de6386cf83c0f0d9b6bd3d371a71a Mon Sep 17 00:00:00 2001 From: Czw <459749926@qq.com> Date: Tue, 17 Oct 2023 10:39:51 +0800 Subject: [PATCH] feat: update --- apps/system/views.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/system/views.py b/apps/system/views.py index 7545b48..0c936f2 100644 --- a/apps/system/views.py +++ b/apps/system/views.py @@ -217,6 +217,9 @@ class UserActionViewSet(FunctionViewSet): serializer.is_valid(raise_exception=True) validated_data = serializer.validated_data + if Team.objects.filter(register_phone=validated_data['phone']).exists(): + raise ValidationError('手机号已注册') + if Team.objects.filter(number=validated_data['number']).exists(): raise ValidationError('公司编号已存在') @@ -233,6 +236,8 @@ class UserActionViewSet(FunctionViewSet): result = requests.post(CRM_URL, data={ 'system': "ERP", 'company': validated_data['number'], + 'username': validated_data['username'], + 'expiry_date': expiry_time.strftime('%Y-%m-%d'), 'register_phone': validated_data['phone'], 'register_city_code': validated_data['register_city_code'], })