修复: 控制台 - 账号 - 账号列表 - 查看账号详情时的500错误

This commit is contained in:
fangfang.dong
2023-06-14 16:21:46 +08:00
committed by Jiangjie.Bai
parent e762a5d8ae
commit e8163167c5

View File

@@ -9,6 +9,8 @@ from rest_framework.request import Request
from common.exceptions import UserConfirmRequired
from common.utils import i18n_fmt
from orgs.utils import current_org
from orgs.models import Organization
from audits.handler import create_or_update_operate_log
from audits.const import ActionChoices, ActivityChoices
from audits.models import ActivityLog
@@ -91,7 +93,8 @@ class RecordViewLogMixin:
activities = [
ActivityLog(
resource_id=getattr(resource_id, 'pk', resource_id),
type=ActivityChoices.operate_log, detail=detail
type=ActivityChoices.operate_log, detail=detail,
org_id=Organization.ROOT_ID if current_org.is_root() else None,
)
for resource_id in ids
]