1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 02:42:47 +00:00

change max share link number (#5603)

This commit is contained in:
Michael An
2023-08-22 17:35:16 +08:00
committed by GitHub
parent e1d4b5908a
commit 73dd04ec10
3 changed files with 9 additions and 4 deletions

View File

@@ -21,6 +21,7 @@ const propTypes = {
};
const inputWidth = Utils.isDesktop() ? 250 : 210;
const SHARE_LINK_MAX_NUMBER = 200;
class LinkCreation extends React.Component {
@@ -155,8 +156,8 @@ class LinkCreation extends React.Component {
this.setState({errorInfo: gettext('Please enter an integer bigger than 1 as number of links.')});
return false;
}
if (parseInt(linkAmount) > 1000) {
this.setState({errorInfo: gettext('Please enter an integer smaller than 1000 as number of links.')});
if (parseInt(linkAmount) > SHARE_LINK_MAX_NUMBER) {
this.setState({errorInfo: gettext('Please enter an integer smaller than 200 as number of links.')});
return false;
}
}

View File

@@ -27,7 +27,8 @@ from seahub.utils import is_org_context, get_password_strength_level, \
is_valid_password, gen_shared_link
from seahub.utils.timeutils import datetime_to_isoformat_timestr
from seahub.utils.repo import parse_repo_perm
from seahub.settings import SHARE_LINK_EXPIRE_DAYS_MAX, SHARE_LINK_EXPIRE_DAYS_MIN, SHARE_LINK_EXPIRE_DAYS_DEFAULT
from seahub.settings import SHARE_LINK_EXPIRE_DAYS_MAX, SHARE_LINK_EXPIRE_DAYS_MIN, SHARE_LINK_EXPIRE_DAYS_DEFAULT, \
SHARE_LINK_MAX_NUMBER
from seahub.views.file import can_edit_file
from seahub.api2.endpoints.share_links import get_share_link_info, check_permissions_arg
@@ -244,7 +245,7 @@ class MultiShareLinksBatch(APIView):
error_msg = 'number invalid.'
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
if share_link_num > 1000:
if share_link_num > SHARE_LINK_MAX_NUMBER:
error_msg = 'number invalid.'
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)

View File

@@ -360,6 +360,9 @@ REPO_PASSWORD_MIN_LENGTH = 8
# token length for the share link
SHARE_LINK_TOKEN_LENGTH = 20
# the maximum number of external share links in a sdoc file
SHARE_LINK_MAX_NUMBER = 200
# if limit only authenticated user can view preview share link
SHARE_LINK_LOGIN_REQUIRED = False