fix: event 导出bug

This commit is contained in:
caoqianming 2023-08-22 11:25:21 +08:00
parent 563893efac
commit ab9b9d9804
2 changed files with 3 additions and 2 deletions

View File

@ -28,6 +28,7 @@ from apps.third.tapis import xxapis
import logging
from datetime import datetime
from apps.utils.img import compress_image
import traceback
myLogger = logging.getLogger('log')
requests.packages.urllib3.disable_warnings()
@ -67,7 +68,7 @@ def compress_global_img(path_file):
out_file, _ = compress_image(full_path_file)
return out_file.replace(settings.BASE_DIR, '')
except:
myLogger.error(f'图片压缩失败-{full_path_file}', exc_info=True)
myLogger.error(f'图片压缩失败-{full_path_file}-{traceback.format_exc()}')
return None
def get_ep_default():

View File

@ -194,7 +194,7 @@ class EventViewSet(ListModelMixin, RetrieveModelMixin, DestroyModelMixin, Custom
i.get('operation_name', None),
i['create_time'],
i.get('handle_user_name', None),
mark_dict[i['mark']],
mark_dict.get(i['mark'], '正常'),
i['global_img_compressed'],
i['face_img']
]