From 9ffb9d56322949ef7db0afea44f6e4b9c856c01a Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 5 Feb 2014 10:23:54 +0100 Subject: [PATCH] [REM] Removed LoginForm javascript related bzr revid: fme@openerp.com-20140205092354-oa6qxm0fsuojhuc2 --- addons/auth_signup/__openerp__.py | 2 +- addons/auth_signup/controllers/main.py | 6 +++--- .../auth_signup/static/src/js/auth_signup.js | 19 ------------------- .../auth_signup/views/auth_signup_login.xml | 15 --------------- 4 files changed, 4 insertions(+), 38 deletions(-) delete mode 100644 addons/auth_signup/static/src/js/auth_signup.js diff --git a/addons/auth_signup/__openerp__.py b/addons/auth_signup/__openerp__.py index 50402207018..2aaaf61d3dd 100644 --- a/addons/auth_signup/__openerp__.py +++ b/addons/auth_signup/__openerp__.py @@ -42,6 +42,6 @@ Allow users to sign up and reset their password 'res_users_view.xml', 'views/auth_signup_login.xml', ], - 'js': ['static/src/js/auth_signup.js'], + 'js': [], 'bootstrap': True, } diff --git a/addons/auth_signup/controllers/main.py b/addons/auth_signup/controllers/main.py index 2db1e3dff65..06c916d9580 100644 --- a/addons/auth_signup/controllers/main.py +++ b/addons/auth_signup/controllers/main.py @@ -30,7 +30,7 @@ from openerp.tools import exception_to_unicode _logger = logging.getLogger(__name__) -class Home(openerp.addons.web.controllers.main.Home): +class AuthSignup(openerp.addons.web.controllers.main.Home): @http.route() def web_login(self, *args, **kw): @@ -60,7 +60,7 @@ class Home(openerp.addons.web.controllers.main.Home): qcontext.update(config) if 'error' in qcontext or mode not in ('reset', 'signup') or (not token and not config[mode]): - response = super(Home, self).web_login(*args, **kw) + response = super(AuthSignup, self).web_login(*args, **kw) if isinstance(response, LazyResponse): response.params['values'].update(config) return response @@ -86,7 +86,7 @@ class Home(openerp.addons.web.controllers.main.Home): request.cr.commit() except SignupError, e: qcontext['error'] = exception_to_unicode(e) - return super(Home, self).web_login(*args, **kw) + return super(AuthSignup, self).web_login(*args, **kw) return response diff --git a/addons/auth_signup/static/src/js/auth_signup.js b/addons/auth_signup/static/src/js/auth_signup.js deleted file mode 100644 index a317440fd6b..00000000000 --- a/addons/auth_signup/static/src/js/auth_signup.js +++ /dev/null @@ -1,19 +0,0 @@ -openerp.auth_signup = function(instance) { - openerp.web.LoginForm.include({ - start: function () { - var self = this; - this.$el.on('submit', function () { - var password = self.get_password_field('password'); - var confirm_password = self.get_password_field('confirm_password'); - if (password && confirm_password && (password.value != confirm_password.value)) { - alert("Passwords do not match; please retype them."); - return false; - } - }); - }, - get_password_field: function (field) { - var selector = 'input[name="' + field + '"][type="password"]:visible'; - return this.$(selector)[0]; - }, - }); -}; diff --git a/addons/auth_signup/views/auth_signup_login.xml b/addons/auth_signup/views/auth_signup_login.xml index bdc093e3c27..cf1f96d49e9 100644 --- a/addons/auth_signup/views/auth_signup_login.xml +++ b/addons/auth_signup/views/auth_signup_login.xml @@ -12,21 +12,6 @@