Skip to content

Commit

Permalink
update useless check about file lock on line 799
Browse files Browse the repository at this point in the history
  • Loading branch information
qubaitian committed Dec 25, 2023
1 parent edd7b47 commit 0abebe9
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions seahub/api2/endpoints/via_repo_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,18 +794,6 @@ def post(self, request, format=None):
error_msg = 'Permission denied.'
return api_error(status.HTTP_403_FORBIDDEN, error_msg)

# check file lock
try:
is_locked, locked_by_me = check_file_lock(repo_id, path, username)
except Exception as e:
logger.error(e)
error_msg = 'Internal Server Error'
return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg)

if is_locked and not locked_by_me:
error_msg = _("File is locked")
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

0 comments on commit 0abebe9

Please sign in to comment.