[Update] 修改会话can_join为property

pull/3896/head
Bai 2020-04-14 16:12:24 +08:00
parent e143408e57
commit 6337d0d0a1
2 changed files with 2 additions and 1 deletions

View File

@ -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)

View File

@ -243,6 +243,7 @@ class Session(OrgModelMixin):
return True
return False
@property
def can_join(self):
if self.is_finished:
return False