Skip to content

Commit 980a27b

Browse files
committed
refactor: add logout
1 parent 8d40004 commit 980a27b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

apps/users/views/user.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
from maxkb.const import CONFIG
2121
from models_provider.api.model import DefaultModelResponse
2222
from tools.serializers.tool import encryption
23-
from users.api import SendEmailAPI, CheckCodeAPI, ResetPasswordAPI
2423
from users.api.user import UserProfileAPI, TestWorkspacePermissionUserApi, DeleteUserApi, EditUserApi, \
25-
ChangeUserPasswordApi, UserPageApi, UserListApi, UserPasswordResponse, WorkspaceUserAPI
24+
ChangeUserPasswordApi, UserPageApi, UserListApi, UserPasswordResponse, WorkspaceUserAPI, ResetPasswordAPI, \
25+
SendEmailAPI, CheckCodeAPI
2626
from users.models import User
2727
from users.serializers.user import UserProfileSerializer, UserManageSerializer, CheckCodeSerializer, \
2828
SendEmailSerializer, RePasswordSerializer
@@ -252,8 +252,8 @@ class SendEmail(APIView):
252252
description=_("Send email"),
253253
operation_id=_("Send email"), # type: ignore
254254
tags=[_("User Management")], # type: ignore
255-
request=SendEmailAPI().get_request(),
256-
responses=SendEmailAPI().get_response())
255+
request=SendEmailAPI.get_request(),
256+
responses=SendEmailAPI.get_response())
257257
@log(menu='User management', operate='Send email',
258258
get_operation_object=lambda r, k: {'name': r.data.get('email', None)},
259259
get_user=lambda r: {'user_name': None, 'email': r.data.get('email', None)})
@@ -270,8 +270,8 @@ class CheckCode(APIView):
270270
description=_("Check whether the verification code is correct"),
271271
operation_id=_("Check whether the verification code is correct"), # type: ignore
272272
tags=[_("User Management")], # type: ignore
273-
request=CheckCodeAPI().get_request(),
274-
responses=CheckCodeAPI().get_response())
273+
request=CheckCodeAPI.get_request(),
274+
responses=CheckCodeAPI.get_response())
275275
@log(menu='User management', operate='Check whether the verification code is correct',
276276
get_operation_object=lambda r, k: {'name': r.data.get('email', None)},
277277
get_user=lambda r: {'user_name': None, 'email': r.data.get('email', None)})
@@ -287,8 +287,8 @@ class SendEmailToCurrentUserView(APIView):
287287
description=_("Send email to current user"),
288288
operation_id=_("Send email to current user"), # type: ignore
289289
tags=[_("User Management")], # type: ignore
290-
request=SendEmailAPI().get_request(),
291-
responses=SendEmailAPI().get_response())
290+
request=SendEmailAPI.get_request(),
291+
responses=SendEmailAPI.get_response())
292292
@log(menu='User management', operate='Send email to current user',
293293
get_operation_object=lambda r, k: {'name': r.user.username})
294294
def post(self, request: Request):

0 commit comments

Comments
 (0)