feat: syslog 记录的数据来源于序列类

This commit is contained in:
Michael Bai
2022-02-08 18:58:56 +08:00
committed by 老广
parent 8085db7acc
commit 67a49dc5e9
3 changed files with 17 additions and 29 deletions

View File

@@ -12,7 +12,7 @@ from rest_framework import viewsets, views
from rest_framework.response import Response
from rest_framework.decorators import action
from common.utils import model_to_json
from common.utils import data_to_json
from .. import utils
from common.const.http import GET
from common.utils import get_logger, get_object_or_none
@@ -62,7 +62,9 @@ class SessionViewSet(OrgBulkModelViewSet):
os.chdir(dir_path)
with open(meta_filename, 'wt') as f:
f.write(model_to_json(session))
serializer = serializers.SessionDisplaySerializer(session)
data = data_to_json(serializer.data)
f.write(data)
with tarfile.open(offline_filename, 'w') as f:
f.add(replay_filename)