[Update] 修改获取录像失败的问题 (#3509)

pull/3515/head
BaiJiangJie 2019-12-06 11:36:36 +08:00 committed by GitHub
parent 47b1a13bea
commit f89c6124a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -15,7 +15,7 @@ from common.permissions import IsOrgAdminOrAppUser, IsOrgAuditor
from common.drf.filters import DatetimeRangeFilter
from orgs.mixins.api import OrgBulkModelViewSet
from ..hands import SystemUser
from ..models import Session
from ..models import Session, ReplayStorage
from .. import serializers
@ -105,9 +105,12 @@ class SessionReplayViewSet(viewsets.ViewSet):
data['src'] = url
return Response(data)
# 去 Session 相关的 Terminal 中关联的存储中查找
replay_storage = session.terminal.get_replay_storage()
configs = {replay_storage.name: replay_storage.config}
replay_storages = ReplayStorage.objects.all()
configs = {
storage.name: storage.config
for storage in replay_storages
if not storage.in_defaults()
}
if not configs:
return HttpResponseNotFound()