Fix name collision between the two organization delete calls

Fixes #2104

The collision was causing the frontend to try to call the *superuser* method (in local, where superuser is enabled), but on prod (where it isn't), it was calling the normal method, which takes a different parameter name
This commit is contained in:
Joseph Schorr 2016-11-10 15:28:20 -05:00
parent 767baa5c8d
commit 932fa56227
2 changed files with 4 additions and 4 deletions

View file

@ -204,7 +204,7 @@ class Organization(ApiResource):
@require_scope(scopes.ORG_ADMIN)
@require_fresh_login
@nickname('deleteOrganization')
@nickname('deleteAdminedOrganization')
def delete(self, orgname):
""" Deletes the specified organization. """
permission = AdministerOrganizationPermission(orgname)

View file

@ -181,6 +181,7 @@ function(ApiService, CookieService, $rootScope, Config, $location) {
return;
}
var errorDisplay = ApiService.errorDisplay('Could not delete namespace', callback);
var deleteNamespaceItself = function() {
info.progress = 1;
info.progressMessage = 'Deleting namespace...';
@ -194,10 +195,10 @@ function(ApiService, CookieService, $rootScope, Config, $location) {
}, errorDisplay);
} else {
var delParams = {
'name': info.organization.name
'orgname': info.organization.name
};
ApiService.deleteOrganization(null, delParams).then(function(resp) {
ApiService.deleteAdminedOrganization(null, delParams).then(function(resp) {
// Reload the user.
userService.load();
callback(true);
@ -235,7 +236,6 @@ function(ApiService, CookieService, $rootScope, Config, $location) {
'public': false
};
var errorDisplay = ApiService.errorDisplay('Could not delete namespace', callback);
ApiService.listRepos(null, params).then(function(resp) {
repositories = resp['repositories'];
deleteAllRepos();