summaryrefslogtreecommitdiff
path: root/addons/auth_signup/res_users.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@openerp.com>2014-03-24 14:38:11 +0100
committerChristophe Simonis <chs@openerp.com>2014-03-24 14:38:11 +0100
commitd93b79e6f4e5c6c2fda65fbf88df8e1851b6fa4d (patch)
treef855bc221056bf09cd4713d6cd44ab6b1449a268 /addons/auth_signup/res_users.py
parent7c4557add24726f34fec3aa834c34fa5c9b1f17f (diff)
parentf4b1d23cf2b44521456b479c1038e17d5ee0bac8 (diff)
[MERGE] forward port of branch saas-3 up to revid 9345 dle@openerp.com-20140324110349-e82t1bmmtjqbl85k
bzr revid: chs@openerp.com-20140324133811-4az1kvbznd26seow
Diffstat (limited to 'addons/auth_signup/res_users.py')
-rw-r--r--addons/auth_signup/res_users.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py
index 4c1c1a671b7..5a744c21c81 100644
--- a/addons/auth_signup/res_users.py
+++ b/addons/auth_signup/res_users.py
@@ -20,8 +20,8 @@
##############################################################################
from datetime import datetime, timedelta
import random
-from urllib import urlencode
from urlparse import urljoin
+import werkzeug
from openerp.addons.base.ir.ir_mail_server import MailDeliveryException
from openerp.osv import osv, fields
@@ -53,7 +53,7 @@ class res_partner(osv.Model):
(not partner.signup_expiration or dt <= partner.signup_expiration)
return res
- def _get_signup_url_for_action(self, cr, uid, ids, action='login', view_type=None, menu_id=None, res_id=None, model=None, context=None):
+ def _get_signup_url_for_action(self, cr, uid, ids, action=None, view_type=None, menu_id=None, res_id=None, model=None, context=None):
""" generate a signup url for the given partner ids and action, possibly overriding
the url state components (menu_id, id, view_type) """
if context is None:
@@ -81,6 +81,8 @@ class res_partner(osv.Model):
continue # no signup token, no user, thus no signup url!
fragment = dict()
+ if action:
+ fragment['action'] = action
if view_type:
fragment['view_type'] = view_type
if menu_id:
@@ -90,7 +92,10 @@ class res_partner(osv.Model):
if res_id:
fragment['id'] = res_id
- res[partner.id] = urljoin(base_url, "/web/%s?%s#%s" % (route, urlencode(query), urlencode(fragment)))
+ if fragment:
+ query['redirect'] = '/web#' + werkzeug.url_encode(fragment)
+
+ res[partner.id] = urljoin(base_url, "/web/%s?%s" % (route, werkzeug.url_encode(query)))
return res