From 0fc0479619ec086a2ca266c1a8b4a25eafa1cfeb Mon Sep 17 00:00:00 2001 From: vapao Date: Wed, 27 Oct 2021 16:05:45 +0800 Subject: [PATCH] =?UTF-8?q?#=20=E4=BC=98=E5=8C=96=E8=B4=A6=E6=88=B7?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_api/apps/account/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spug_api/apps/account/views.py b/spug_api/apps/account/views.py index 1307ed3..62855d8 100644 --- a/spug_api/apps/account/views.py +++ b/spug_api/apps/account/views.py @@ -78,6 +78,8 @@ class UserView(View): if user: if user.type == 'ldap': return json_response(error='ldap账户无法删除,请使用禁用功能来禁止该账户访问系统') + if user.id == request.user.id: + return json_response(error='无法删除当前登录账户') user.is_active = True user.deleted_at = human_datetime() user.deleted_by = request.user