fix: 修复 ftp 审计日志上传失败

pull/9669/head
Eric 2023-02-21 19:35:35 +08:00
parent b5d814e9be
commit 31a3e3b177
1 changed files with 3 additions and 2 deletions

View File

@ -10,7 +10,7 @@ from rest_framework.permissions import IsAuthenticated
from common.drf.filters import DatetimeRangeFilter
from common.plugins.es import QuerySet as ESQuerySet
from common.utils import is_uuid
from orgs.mixins.api import OrgReadonlyModelViewSet
from orgs.mixins.api import OrgReadonlyModelViewSet, OrgModelViewSet
from orgs.utils import current_org, tmp_to_root_org
from users.models import User
from .backends import TYPE_ENGINE_MAPPING
@ -35,7 +35,7 @@ class JobAuditViewSet(OrgReadonlyModelViewSet):
ordering = ['-date_start']
class FTPLogViewSet(OrgReadonlyModelViewSet):
class FTPLogViewSet(OrgModelViewSet):
model = FTPLog
serializer_class = FTPLogSerializer
extra_filter_backends = [DatetimeRangeFilter]
@ -45,6 +45,7 @@ class FTPLogViewSet(OrgReadonlyModelViewSet):
filterset_fields = ['user', 'asset', 'account', 'filename']
search_fields = filterset_fields
ordering = ['-date_start']
http_method_names = ['post', 'get', 'head', 'options']
class UserLoginCommonMixin: