feat: session.Task model add kwargs field (记录kill_session的用户名称)

This commit is contained in:
Bai
2021-07-29 14:53:04 +08:00
committed by Jiangjie.Bai
parent bff3582136
commit 7892e50aa2
3 changed files with 23 additions and 2 deletions

View File

@@ -31,7 +31,9 @@ class KillSessionAPI(APIView):
if session and not session.is_finished:
validated_session.append(session_id)
self.model.objects.create(
name="kill_session", args=session.id,
terminal=session.terminal,
name="kill_session", args=session.id, terminal=session.terminal,
kwargs={
'terminated_by_user': str(request.user)
}
)
return Response({"ok": validated_session})