mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-26 15:26:19 +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)
|
repo = seafile_api.get_repo(repo_id)
|
||||||
if not repo:
|
if not repo:
|
||||||
error_msg = 'Library %s not found.' % repo_id
|
# for case of `seafile-data` has been damaged
|
||||||
return api_error(status.HTTP_404_NOT_FOUND, error_msg)
|
# 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
|
# check permission
|
||||||
username = request.user.username
|
username = request.user.username
|
||||||
|
Reference in New Issue
Block a user