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:
parent
767baa5c8d
commit
932fa56227
2 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
Reference in a new issue