From 34b2a5fe0b76c0674e80d8d1b5f1ddf50024d54a Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 9 Jun 2021 15:46:32 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E5=A4=8D=E4=B8=8A=E6=AC=A1?= =?UTF-8?q?=E5=BC=95=E8=B5=B7=E7=9A=84=E5=B0=8Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/authentication/api/connection_token.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/authentication/api/connection_token.py b/apps/authentication/api/connection_token.py index 6c65ec20f..a50de0371 100644 --- a/apps/authentication/api/connection_token.py +++ b/apps/authentication/api/connection_token.py @@ -220,7 +220,7 @@ class UserConnectionTokenViewSet(RootOrgViewMixin, SerializerMixin2, GenericView raise serializers.ValidationError('Token not found') user = get_object_or_404(User, id=value.get('user')) - if user.is_valid: + if not user.is_valid: raise serializers.ValidationError("User not valid, disabled or expired") system_user = get_object_or_404(SystemUser, id=value.get('system_user'))