Get success message in user edit form when default password is resetted (Fixes #1817).

This commit is contained in:
Emanuel Schuetze 2016-02-23 23:51:42 +01:00
parent 73cc1a5dfb
commit bed96f66b0

View File

@ -318,11 +318,17 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
type: 'input', type: 'input',
templateOptions: { templateOptions: {
label: gettextCatalog.getString('Default password'), label: gettextCatalog.getString('Default password'),
description: '',
addonRight: { text: 'Reset', class: 'fa fa-undo', onClick: addonRight: { text: 'Reset', class: 'fa fa-undo', onClick:
function (options, scope) { function (options, scope) {
$http.post( $http.post(
'/rest/users/user/' + scope.model.id + '/reset_password/', '/rest/users/user/' + scope.model.id + '/reset_password/',
{'password': scope.model.default_password}) {'password': scope.model.default_password})
.then(function() {
options.templateOptions.description =
gettextCatalog.getString('Password successfully resetted to:') +
' ' + scope.model.default_password;
});
} }
} }
} }