[FIX] auth_signup: no SQL error for duplicated user
In case of registration with an already existant user, an SQL error 'duplicate key value violates unique constaint res_users_login_key...' Replace by a more user friendly error. Fixes #10068, opw 659913
This commit is contained in:
parent
f9f7669e60
commit
5425316eff
|
@ -54,7 +54,11 @@ class AuthSignupHome(openerp.addons.web.controllers.main.Home):
|
||||||
self.do_signup(qcontext)
|
self.do_signup(qcontext)
|
||||||
return super(AuthSignupHome, self).web_login(*args, **kw)
|
return super(AuthSignupHome, self).web_login(*args, **kw)
|
||||||
except (SignupError, AssertionError), e:
|
except (SignupError, AssertionError), e:
|
||||||
qcontext['error'] = _(e.message)
|
if request.env["res.users"].sudo().search([("login", "=", qcontext.get("login"))]):
|
||||||
|
qcontext["error"] = _("Another user is already registered using this email address.")
|
||||||
|
else:
|
||||||
|
_logger.error(e.message)
|
||||||
|
qcontext['error'] = _("Could not create a new account.")
|
||||||
|
|
||||||
return request.render('auth_signup.signup', qcontext)
|
return request.render('auth_signup.signup', qcontext)
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 8.0\n"
|
"Project-Id-Version: Odoo Server 8.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2015-01-21 14:07+0000\n"
|
"POT-Creation-Date: 2015-12-16 13:15+0000\n"
|
||||||
"PO-Revision-Date: 2015-01-21 14:07+0000\n"
|
"PO-Revision-Date: 2015-12-16 13:15+0000\n"
|
||||||
"Last-Translator: <>\n"
|
"Last-Translator: <>\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
|
@ -86,7 +86,13 @@ msgid "An invitation email containing the following subscription link has been s
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: auth_signup
|
#. module: auth_signup
|
||||||
#: code:addons/auth_signup/controllers/main.py:125
|
#: code:addons/auth_signup/controllers/main.py:58
|
||||||
|
#, python-format
|
||||||
|
msgid "Another user is already registered using this email address."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: auth_signup
|
||||||
|
#: code:addons/auth_signup/controllers/main.py:130
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Authentification Failed."
|
msgid "Authentification Failed."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -109,7 +115,13 @@ msgid "Confirm Password"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: auth_signup
|
#. module: auth_signup
|
||||||
#: code:addons/auth_signup/controllers/main.py:80
|
#: code:addons/auth_signup/controllers/main.py:61
|
||||||
|
#, python-format
|
||||||
|
msgid "Could not create a new account."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: auth_signup
|
||||||
|
#: code:addons/auth_signup/controllers/main.py:84
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Could not reset your password"
|
msgid "Could not reset your password"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -160,6 +172,12 @@ msgstr ""
|
||||||
msgid "Reset password"
|
msgid "Reset password"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: auth_signup
|
||||||
|
#: code:addons/auth_signup/res_users.py:267
|
||||||
|
#, python-format
|
||||||
|
msgid "Reset password: invalid username or email"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: auth_signup
|
#. module: auth_signup
|
||||||
#: view:res.users:auth_signup.res_users_form_view
|
#: view:res.users:auth_signup.res_users_form_view
|
||||||
msgid "Send Reset Password Instructions"
|
msgid "Send Reset Password Instructions"
|
||||||
|
|
Loading…
Reference in New Issue