[FIX] portal: don't eagerly load security template

There's absolutely no need to load it on every page of the website. It
probably doesn't even need to be cached on the JS side given it's used
in all of 3 actions of the portal user's security page.

Reported by jke.

Also remove leftover console.log call while at it.

closes odoo/odoo#57636

X-original-commit: 00c1c9a7258cf53f1a40938e3a928151b188de64
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
This commit is contained in:
Xavier Morel
2020-09-14 11:33:55 +00:00
parent ab59d0bf09
commit 5d25d0e927
2 changed files with 1 additions and 4 deletions
@@ -183,7 +183,6 @@ publicWidget.registry.TOTPButton = publicWidget.Widget.extend({
document.getElementById('totp_wizard_view').textContent,
'application/xhtml+xml'
);
console.log(doc);
const xmlBody = doc.querySelector('sheet *');
const [body, , codeInput] = fixupViewBody(xmlBody, record);
+1 -3
View File
@@ -163,8 +163,6 @@ publicWidget.registry.portalSearchPanel = publicWidget.Widget.extend({
},
});
const tmpl = ajax.loadXML('/portal/static/src/xml/portal_security.xml', qweb);
/**
* Wraps an RPC call in a check for the result being an identity check action
* descriptor. If no such result is found, just returns the wrapped promise's
@@ -184,7 +182,7 @@ function handleCheckIdentity(rpc, wrapped) {
return r;
}
const check_id = r.res_id;
return tmpl.then(() => new Promise((resolve, reject) => {
return ajax.loadXML('/portal/static/src/xml/portal_security.xml', qweb).then(() => new Promise((resolve, reject) => {
const d = new Dialog(null, {
title: _t("Security Control"),
$content: qweb.render('portal.identitycheck'),