[FIX] auth_password_policy: remove deferred when not needed
When auth_password_policy is installed, and a field with `password="True"` is in a res.config.settings (eg. google calendar is installed) we could have an error caused by deferred not expected in the res.config.settings _render. Since the RPC is only needed when the password_policy has been been defined, this commit do this removing the error that currently happened. A customization of res.config.settings adding password_meter would still break settings (but it is currently not done) and will be solved in a future fix. closes #27426
This commit is contained in:
@@ -21,12 +21,12 @@ var PasswordField = fields.InputField.extend({
|
|||||||
},
|
},
|
||||||
willStart: function () {
|
willStart: function () {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
var getPolicy = this._rpc({
|
var getPolicy = this.nodeOptions['password_meter'] ? this._rpc({
|
||||||
model: 'res.users',
|
model: 'res.users',
|
||||||
method: 'get_password_policy',
|
method: 'get_password_policy',
|
||||||
}).then(function (p) {
|
}).then(function (p) {
|
||||||
_this._meter = new Meter(_this, new policy.Policy(p), policy.recommendations);
|
_this._meter = new Meter(_this, new policy.Policy(p), policy.recommendations);
|
||||||
});
|
}) : undefined;
|
||||||
return $.when(
|
return $.when(
|
||||||
this._super.apply(this, arguments),
|
this._super.apply(this, arguments),
|
||||||
getPolicy
|
getPolicy
|
||||||
|
|||||||
Reference in New Issue
Block a user