-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update repo trash #6148
update repo trash #6148
Conversation
aa7e311
to
8b660c3
Compare
7a7a9c4
to
6df93c8
Compare
554ddbd
to
8346741
Compare
eff201a
to
5987b11
Compare
0d082e6
to
d63ac28
Compare
a06e5b4
to
b94ef7a
Compare
b94ef7a
to
86cbf7b
Compare
seahub/api2/endpoints/dir.py
Outdated
@@ -561,7 +562,9 @@ def delete(self, request, repo_id, format=None): | |||
username = request.user.username | |||
parent_dir = os.path.dirname(path) | |||
dir_name = os.path.basename(path) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文件没有变化,把改动和import等内容删掉
seahub/api2/endpoints/file.py
Outdated
@@ -5,6 +5,7 @@ | |||
import logging | |||
import posixpath | |||
import requests | |||
import datetime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
seahub/api2/views.py
Outdated
@@ -144,6 +144,7 @@ | |||
|
|||
from constance import config | |||
|
|||
|
|||
logger = logging.getLogger(__name__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
删掉改动
@@ -1095,6 +1095,7 @@ def react_fake_view(request, **kwargs): | |||
'upload_link_expire_days_max': UPLOAD_LINK_EXPIRE_DAYS_MAX, | |||
'enable_encrypted_library': config.ENABLE_ENCRYPTED_LIBRARY, | |||
'enable_repo_history_setting': config.ENABLE_REPO_HISTORY_SETTING, | |||
'enable_clean': config.ENABLE_USER_CLEAN_TRASH, | |||
'enable_reset_encrypted_repo_password': ENABLE_RESET_ENCRYPTED_REPO_PASSWORD, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enable_clean --> enable_user_clean_trash
@@ -109,6 +109,7 @@ | |||
canPublishRepo: {% if user.permissions.can_publish_repo %} true {% else %} false {% endif %}, | |||
enableEncryptedLibrary: {% if enable_encrypted_library %} true {% else %} false {% endif %}, | |||
enableRepoHistorySetting: {% if enable_repo_history_setting %} true {% else %} false {% endif %}, | |||
enableClean: {% if enable_clean %} true {% else %} false {% endif %}, | |||
isSystemStaff: {% if request.user.is_staff %} true {% else %} false {% endif %}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enableClean-->enableUserCleanTrash
sql/mysql.sql
Outdated
`size` bigint(20) NOT NULL, | ||
PRIMARY KEY (`id`), | ||
KEY `ix_FileTrash_repo_id` (`repo_id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CHARSET=utf8mb4 COLLATE=utf8_general_ci;
seahub/api2/endpoints/repo_trash.py
Outdated
|
||
# argument check | ||
path = request.data.get('path', '/') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个请求参数不需要了, 直接写 path = '/' 就可以了
for item in deleted_entries: | ||
item_info = self.get_item_info(item) | ||
items.append(item_info) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在seafevents层面直接排序后返回, 不需要直接在这里进行排序
seahub/api2/endpoints/repo_trash.py
Outdated
current_page = int(request.GET.get('page', '1')) | ||
per_page = int(request.GET.get('per_page', '100')) | ||
if per_page > 100: | ||
per_page = 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
大于100这个判断不用加, 这里只是默认返回100条目, 具体请求多少条目不需要判断
No description provided.