Browse Source

Merge pull request #547 from bealdav/patch-3

[FIX]  add _() on strings on secure_uninstall
pull/549/head
Yannick Vaucher 8 years ago
committed by GitHub
parent
commit
f5c5200bcf
  1. 10
      secure_uninstall/models/module.py

10
secure_uninstall/models/module.py

@ -2,7 +2,7 @@
# Copyright 2014 David BEAL @ Akretion <david.beal@akretion.com> # Copyright 2014 David BEAL @ Akretion <david.beal@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
from openerp import _, models, fields, api
from openerp.exceptions import Warning as UserError from openerp.exceptions import Warning as UserError
from openerp.tools.config import config from openerp.tools.config import config
@ -24,20 +24,20 @@ class BaseModuleUpgrade(models.TransientModel):
def upgrade_module(self): def upgrade_module(self):
for elm in self: for elm in self:
if not config.get("secure_uninstall"): if not config.get("secure_uninstall"):
raise UserError(
raise UserError(_(
"Missing configuration key\n--------------------\n" "Missing configuration key\n--------------------\n"
"'secure_uninstall' configuration key " "'secure_uninstall' configuration key "
"is not set in \n" "is not set in \n"
"your Odoo server configuration file: " "your Odoo server configuration file: "
"please set it a value")
"please set it a value"))
if elm.uninstall_password not in _get_authorized_password(): if elm.uninstall_password not in _get_authorized_password():
raise UserError(
raise UserError(_(
"Password Error\n--------------------\n" "Password Error\n--------------------\n"
"Provided password '%s' doesn't match with " "Provided password '%s' doesn't match with "
"'Master Password'\n('secure_uninstall' key) found in " "'Master Password'\n('secure_uninstall' key) found in "
"the Odoo server configuration file ." "the Odoo server configuration file ."
"\n\nResolution\n-------------\n" "\n\nResolution\n-------------\n"
"Please check your password and retry or cancel"
"Please check your password and retry or cancel")
% elm.uninstall_password) % elm.uninstall_password)
# keep this password in db is insecure, then we remove it # keep this password in db is insecure, then we remove it
elm.uninstall_password = False elm.uninstall_password = False

Loading…
Cancel
Save