mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-25 14:50:29 +00:00
still remove repo when data is damaged in seafile-date (#4105)
This commit is contained in:
@@ -351,8 +351,17 @@ class RepoView(APIView):
|
||||
|
||||
repo = seafile_api.get_repo(repo_id)
|
||||
if not repo:
|
||||
error_msg = 'Library %s not found.' % repo_id
|
||||
return api_error(status.HTTP_404_NOT_FOUND, error_msg)
|
||||
# for case of `seafile-data` has been damaged
|
||||
# no `repo object` will be returned from seafile api
|
||||
# delete the database record anyway
|
||||
try:
|
||||
seafile_api.remove_repo(repo_id)
|
||||
except Exception as e:
|
||||
logger.error(e)
|
||||
error_msg = 'Internal Server Error'
|
||||
return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg)
|
||||
|
||||
return Response({'success': True})
|
||||
|
||||
# check permission
|
||||
username = request.user.username
|
||||
|
Reference in New Issue
Block a user