1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 15:19:06 +00:00

repair exception

This commit is contained in:
王健辉
2019-06-14 13:39:36 +08:00
parent 95aeb7a279
commit 2a4532ae19

View File

@@ -6,8 +6,6 @@ from rest_framework.response import Response
from rest_framework import status from rest_framework import status
from seaserv import seafile_api from seaserv import seafile_api
from pysearpc import SearpcError
from seahub.signals import repo_restored from seahub.signals import repo_restored
from seahub.api2.throttling import UserRateThrottle from seahub.api2.throttling import UserRateThrottle
from seahub.api2.authentication import TokenAuthentication from seahub.api2.authentication import TokenAuthentication
@@ -71,7 +69,7 @@ class DeletedRepos(APIView):
try: try:
seafile_api.restore_repo_from_trash(repo_id) seafile_api.restore_repo_from_trash(repo_id)
repo_restored.send(sender=None, repo_id=repo_id, operator=username) repo_restored.send(sender=None, repo_id=repo_id, operator=username)
except SearpcError as e: except Exception as e:
logger.error(e) logger.error(e)
error_msg = "Internal Server Error" error_msg = "Internal Server Error"
return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg) return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg)