From 539a71ba59c2f88fa95a263c656d79d777695a3d Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 6 Dec 2023 09:24:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20base=20=E5=8E=BB=E9=99=A4=E4=B8=8D?= =?UTF-8?q?=E5=BF=85=E8=A6=81=E7=9A=84=E8=80=A6=E5=90=88=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + apps/system/errors.py | 1 + apps/system/serializers.py | 4 +--- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index e3e9267a..6f559e20 100755 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ h5/* *.pyc media/* dist/* +pkgs/* !media/default/ celerybeat.pid celerybeat-schedule.bak diff --git a/apps/system/errors.py b/apps/system/errors.py index ef2d1eb2..daa63d73 100755 --- a/apps/system/errors.py +++ b/apps/system/errors.py @@ -7,3 +7,4 @@ FUNC_ERROR = {"code": "func_error", "detail": "执行方法有误"} USERNAME_EXIST = {"code": "username_exist", "detail": "账户已存在"} ROLE_NAME_EXIST = {"code": "role_name_exist", "detail": "角色名已存在"} ROLE_CODE_EXIST = {"code": "role_code_exist", "detail": "角色标识已存在"} +PHONE_EXIST = {"code": "phone_exist", "detail": "手机号已存在"} diff --git a/apps/system/serializers.py b/apps/system/serializers.py index 4e7e01f1..3e7c82ea 100755 --- a/apps/system/serializers.py +++ b/apps/system/serializers.py @@ -262,13 +262,11 @@ class DeptCreateUpdateSerializer(CustomModelSerializer): @transaction.atomic def create(self, validated_data): ins = super().create(validated_data) - sync_dahua_dept(ins) return ins @transaction.atomic def update(self, instance, validated_data): ins = super().update(instance, validated_data) - sync_dahua_dept(ins) return ins @@ -304,7 +302,7 @@ class UserListSerializer(CustomModelSerializer): def phone_exist(phone): if User.objects.filter(phone=phone).exists(): - raise serializers.ValidationError(**PHONE_EXIST) + raise serializers.ValidationError('手机号已存在') def user_exist(username):