mirror of
https://github.com/ansible/awx.git
synced 2026-02-17 19:20:05 -03:30
Fixed issue with selected users based on user.id rathr than set index. Fixed dataLoad callback not being destroyed after controller routine exits.
This commit is contained in:
@@ -63,17 +63,25 @@ function AdminsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
||||
});
|
||||
|
||||
if (scope.selected.length > 0 ) {
|
||||
var user;
|
||||
for (var i=0; i < scope.selected.length; i++) {
|
||||
//var admin = scope.admins[scope.selected[i]].username;
|
||||
Rest.post(scope.admins[scope.selected[i]])
|
||||
.success( function(data, status, headers, config) {
|
||||
scope.queue.push({ result: 'success', data: data, status: status });
|
||||
scope.$emit('callFinished');
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
scope.queue.push({ result: 'error', data: data, status: status, headers: headers });
|
||||
scope.$emit('callFinished');
|
||||
});
|
||||
user = null;
|
||||
for (var j=0; j < scope.admins.length; j++) {
|
||||
if (scope.admins[j].id == scope.selected[i]) {
|
||||
user = scope.admins[j];
|
||||
}
|
||||
}
|
||||
if (user !== null) {
|
||||
Rest.post(user)
|
||||
.success( function(data, status, headers, config) {
|
||||
scope.queue.push({ result: 'success', data: data, status: status });
|
||||
scope.$emit('callFinished');
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
scope.queue.push({ result: 'error', data: data, status: status, headers: headers });
|
||||
scope.$emit('callFinished');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user