From f544e5b5a80353871de11832a15c68ea7816919f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E6=B0=B8=E5=BC=BA?= <11704063+s-yongqiang@user.noreply.gitee.com> Date: Fri, 25 Oct 2024 10:37:10 +0800 Subject: [PATCH] optimize --- seahub/api2/endpoints/internal_api.py | 2 +- seahub/role_permissions/settings.py | 8 ++++---- seahub/urls.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/seahub/api2/endpoints/internal_api.py b/seahub/api2/endpoints/internal_api.py index 192bf4e96e..430ad06e18 100644 --- a/seahub/api2/endpoints/internal_api.py +++ b/seahub/api2/endpoints/internal_api.py @@ -191,7 +191,7 @@ def post(self, request, repo_id): return Response({'user': rat.app_name}) -class InternalDownloadRateLimited(APIView): +class InternalDownloadRateLimitView(APIView): authentication_classes = (SessionCRSFCheckFreeAuthentication, ) def post(self, request): diff --git a/seahub/role_permissions/settings.py b/seahub/role_permissions/settings.py index 10334a29bc..3e069cc875 100644 --- a/seahub/role_permissions/settings.py +++ b/seahub/role_permissions/settings.py @@ -46,8 +46,8 @@ def merge_roles(default, custom): 'can_publish_repo': True, 'upload_rate_limit': 0, 'download_rate_limit': 0, - 'monthly_rate_limit': 1000, - 'monthly_rate_limit_per_user': 1000 + 'monthly_rate_limit': 0, + 'monthly_rate_limit_per_user': 0 }, GUEST_USER: { 'can_add_repo': False, @@ -70,8 +70,8 @@ def merge_roles(default, custom): 'can_publish_repo': False, 'upload_rate_limit': 0, 'download_rate_limit': 0, - 'monthly_rate_limit': 1000, - 'monthly_rate_limit_per_user': 1000 + 'monthly_rate_limit': 0, + 'monthly_rate_limit_per_user': 0 }, } diff --git a/seahub/urls.py b/seahub/urls.py index 26c3d1aeaf..3b0ec63964 100644 --- a/seahub/urls.py +++ b/seahub/urls.py @@ -5,7 +5,7 @@ from seahub.ai.apis import ImageCaption, GenerateSummary from seahub.api2.endpoints.share_link_auth import ShareLinkUserAuthView, ShareLinkEmailAuthView from seahub.api2.endpoints.internal_api import InternalUserListView, InternalCheckShareLinkAccess, \ - InternalCheckFileOperationAccess, InternalDownloadRateLimited + InternalCheckFileOperationAccess, InternalDownloadRateLimitView from seahub.auth.views import multi_adfs_sso, login_simple_check from seahub.views import * from seahub.views.mobile import mobile_login @@ -796,7 +796,7 @@ re_path(r'^api/v2.1/internal/user-list/$', InternalUserListView.as_view(), name="api-v2.1-internal-user-list"), re_path(r'^api/v2.1/internal/check-share-link-access/$', InternalCheckShareLinkAccess.as_view(), name="api-v2.1-internal-share-link-info"), re_path(r'^api/v2.1/internal/repos/(?P[-0-9a-f]{36})/check-access/$', InternalCheckFileOperationAccess.as_view(), name="api-v2.1-internal-check-file-op-access"), - re_path(r'^api/v2.1/internal/download-limit/$', InternalDownloadRateLimited.as_view(), name='api-v2.1-internal-download-limit'), + re_path(r'^api/v2.1/internal/download-limit/$', InternalDownloadRateLimitView.as_view(), name='api-v2.1-internal-download-limit'), ### system admin ### re_path(r'^sys/seafadmin/delete/(?P[-0-9a-f]{36})/$', sys_repo_delete, name='sys_repo_delete'), path('sys/useradmin/export-excel/', sys_useradmin_export_excel, name='sys_useradmin_export_excel'),