diff --git a/seahub/api2/views.py b/seahub/api2/views.py index c9bfcf22f3..e9d338fa72 100644 --- a/seahub/api2/views.py +++ b/seahub/api2/views.py @@ -3166,8 +3166,7 @@ class GroupRepo(APIView): group_id = group.id if not group.is_staff and not seafile_api.is_repo_owner(username, repo_id): - return api_error(status.HTTP_403_FORBIDDEN, - 'You do not have permission to delete repo.') + return api_error(status.HTTP_403_FORBIDDEN, 'Permission denied.') if seaserv.is_org_group(group_id): org_id = seaserv.get_org_id_by_group(group_id) diff --git a/seahub/templates/libraries.html b/seahub/templates/libraries.html index 0cfdb82b46..e5b3b3c27a 100644 --- a/seahub/templates/libraries.html +++ b/seahub/templates/libraries.html @@ -173,7 +173,7 @@
diff --git a/static/scripts/app/views/group-repo.js b/static/scripts/app/views/group-repo.js index e4b5f3ff2b..322b1756ac 100644 --- a/static/scripts/app/views/group-repo.js +++ b/static/scripts/app/views/group-repo.js @@ -44,13 +44,21 @@ define([ }, unshare: function() { + var lib_name = this.model.get('name'); this.model.destroy({ wait: true, - success: function(model, rep) { - Common.feedback(gettext('Success'), 'success', Common.SUCCESS_TIMOUT); + success: function() { + var msg = gettext('Successfully unshared {placeholder}').replace('{placeholder}', '' + Common.HTMLescape(lib_name) + ''); + Common.feedback(msg, 'success', Common.SUCCESS_TIMOUT); }, - error: function() { - Common.feedback(gettext('Error'), 'error', Common.ERROR_TIMEOUT); + error: function(model, response) { + var err; + if (response.responseText) { + err = $.parseJSON(response.responseText).error_msg; + } else { + err = gettext("Failed. Please check the network."); + } + Common.feedback(err, 'error'); } }); },