[FIX] Fix reset password token issue
bzr revid: vta@openerp.com-20121231150239-oeuvnwbpsvyzh5v5
This commit is contained in:
parent
ad7c08b2c4
commit
a9e53f724f
|
@ -256,7 +256,6 @@ class res_users(osv.Model):
|
|||
raise osv.except_osv(_("Cannot send email: no outgoing email server configured.\nYou can configure it under Settings/General Settings."), user.name)
|
||||
else:
|
||||
raise osv.except_osv(_("Mail sent to:"), user.email)
|
||||
|
||||
return True
|
||||
|
||||
def create(self, cr, uid, values, context=None):
|
||||
|
@ -264,5 +263,7 @@ class res_users(osv.Model):
|
|||
user_id = super(res_users, self).create(cr, uid, values, context=context)
|
||||
user = self.browse(cr, uid, user_id, context=context)
|
||||
if context and context.get('reset_password') and user.email:
|
||||
user.action_reset_password()
|
||||
return user_id
|
||||
try:
|
||||
user.action_reset_password()
|
||||
finally:
|
||||
return user_id
|
||||
|
|
|
@ -144,6 +144,7 @@ openerp.auth_signup = function(instance) {
|
|||
self.show_error(result.error);
|
||||
} else {
|
||||
super_.apply(self, [ev]);
|
||||
window.location = "/#action=login";
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -44,9 +44,8 @@ openerp.portal_anonymous = function(instance) {
|
|||
start: function() {
|
||||
var self = this;
|
||||
return $.when(this._super()).then(function() {
|
||||
var params = $.deparam($.param.querystring());
|
||||
var dblist = self.db_list || [];
|
||||
if (!self.session.session_is_valid() && dblist.length === 1 && (!params.token || !params.login)) {
|
||||
if (!self.session.session_is_valid() && dblist.length === 1 && _.isEmpty(self.params)) {
|
||||
self.remember_credentials = false;
|
||||
// XXX get login/pass from server (via a rpc call) ?
|
||||
return self.do_login(dblist[0], 'anonymous', 'anonymous');
|
||||
|
@ -93,7 +92,7 @@ openerp.portal_anonymous = function(instance) {
|
|||
},
|
||||
// Avoid browser preloading
|
||||
show_application: function() {
|
||||
var params = $.deparam($.param.querystring());
|
||||
var params = $.deparam($.param.fragment());
|
||||
if (!!params.token || !!params.login) {
|
||||
return this.show_login();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue