Skip to content

Commit

Permalink
update useless condition on line 811
Browse files Browse the repository at this point in the history
  • Loading branch information
qubaitian committed Dec 25, 2023
1 parent 92cfa42 commit edd7b47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 0 additions & 6 deletions seahub/api2/endpoints/via_repo_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,12 +806,6 @@ def post(self, request, format=None):
error_msg = _("File is locked")
return api_error(status.HTTP_403_FORBIDDEN, error_msg)

else:
# file NOT exists in repo
if check_folder_permission(request, repo_id, '/') != PERMISSION_READ_WRITE:
error_msg = 'Permission denied.'
return api_error(status.HTTP_403_FORBIDDEN, error_msg)

try:
seafile_api.revert_file(repo_id, commit_id, path, username)
except Exception as e:
Expand Down
8 changes: 4 additions & 4 deletions seahub/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,10 @@
re_path(r'^api/v2.1/via-repo-token/upload-link/$', ViaRepoUploadLinkView.as_view(), name='via-upload-link'),
re_path(r'^api/v2.1/via-repo-token/download-link/$', ViaRepoDownloadLinkView.as_view(), name='via-download-link'),
re_path(r'^api/v2.1/via-repo-token/repo-info/$', RepoInfoView.as_view(), name='via-fetch-repo'),
re_path(r'^api/v2.1/via-repo-token/sync-batch-move-item/$', ViaRepoBatchMove.as_view(), name='via-fetch-repo'),
re_path(r'^api/v2.1/via-repo-token/sync-batch-copy-item/$', ViaRepoBatchCopy.as_view(), name='via-fetch-repo'),
re_path(r'^api/v2.1/via-repo-token/batch-delete-item/$', ViaRepoBatchDelete.as_view(), name='via-fetch-repo'),
re_path(r'^api/v2.1/via-repo-token/file/$', ViaRepoTokenFile.as_view(), name='via-fetch-repo'),
re_path(r'^api/v2.1/via-repo-token/sync-batch-move-item/$', ViaRepoBatchMove.as_view(), name='via-repo-token-move'),
re_path(r'^api/v2.1/via-repo-token/sync-batch-copy-item/$', ViaRepoBatchCopy.as_view(), name='via-repo-token-copy'),
re_path(r'^api/v2.1/via-repo-token/batch-delete-item/$', ViaRepoBatchDelete.as_view(), name='via-repo-token-delete'),
re_path(r'^api/v2.1/via-repo-token/file/$', ViaRepoTokenFile.as_view(), name='via-repo-token-file'),

# user::related-files
re_path(r'^api/v2.1/related-files/$', RelatedFilesView.as_view(), name='api-v2.1-related-files'),
Expand Down

0 comments on commit edd7b47

Please sign in to comment.