mirror of https://github.com/jumpserver/jumpserver
[Update] 修改会话can_join为property
parent
e143408e57
commit
6337d0d0a1
|
@ -141,7 +141,7 @@ class SessionJoinValidateAPI(views.APIView):
|
|||
if not session:
|
||||
msg = _('Session does not exist: {}'.format(session_id))
|
||||
return Response({'ok': False, 'msg': msg}, status=401)
|
||||
if not session.can_join():
|
||||
if not session.can_join:
|
||||
msg = _('Session is finished or the protocol not supported')
|
||||
return Response({'ok': False, 'msg': msg}, status=401)
|
||||
|
||||
|
|
|
@ -243,6 +243,7 @@ class Session(OrgModelMixin):
|
|||
return True
|
||||
return False
|
||||
|
||||
@property
|
||||
def can_join(self):
|
||||
if self.is_finished:
|
||||
return False
|
||||
|
|
Loading…
Reference in New Issue