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:
@@ -21,6 +21,7 @@ const propTypes = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const inputWidth = Utils.isDesktop() ? 250 : 210;
|
const inputWidth = Utils.isDesktop() ? 250 : 210;
|
||||||
|
const SHARE_LINK_MAX_NUMBER = 200;
|
||||||
|
|
||||||
class LinkCreation extends React.Component {
|
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.')});
|
this.setState({errorInfo: gettext('Please enter an integer bigger than 1 as number of links.')});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (parseInt(linkAmount) > 1000) {
|
if (parseInt(linkAmount) > SHARE_LINK_MAX_NUMBER) {
|
||||||
this.setState({errorInfo: gettext('Please enter an integer smaller than 1000 as number of links.')});
|
this.setState({errorInfo: gettext('Please enter an integer smaller than 200 as number of links.')});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,8 @@ from seahub.utils import is_org_context, get_password_strength_level, \
|
|||||||
is_valid_password, gen_shared_link
|
is_valid_password, gen_shared_link
|
||||||
from seahub.utils.timeutils import datetime_to_isoformat_timestr
|
from seahub.utils.timeutils import datetime_to_isoformat_timestr
|
||||||
from seahub.utils.repo import parse_repo_perm
|
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.views.file import can_edit_file
|
||||||
from seahub.api2.endpoints.share_links import get_share_link_info, check_permissions_arg
|
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.'
|
error_msg = 'number invalid.'
|
||||||
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
|
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.'
|
error_msg = 'number invalid.'
|
||||||
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
|
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
|
||||||
|
|
||||||
|
@@ -360,6 +360,9 @@ REPO_PASSWORD_MIN_LENGTH = 8
|
|||||||
# token length for the share link
|
# token length for the share link
|
||||||
SHARE_LINK_TOKEN_LENGTH = 20
|
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
|
# if limit only authenticated user can view preview share link
|
||||||
SHARE_LINK_LOGIN_REQUIRED = False
|
SHARE_LINK_LOGIN_REQUIRED = False
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user