summaryrefslogtreecommitdiff
path: root/addons/payment_authorize/controllers/main.py
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2017-05-11 11:55:22 +0200
committerXavier Morel <xmo@odoo.com>2017-05-15 12:26:30 +0200
commit01e35141479b8dfc4a390518f89fc52e7cec5396 (patch)
tree24ac6661613e8088140eb607e604d44b2ff5ce42 /addons/payment_authorize/controllers/main.py
parent54df4b36d7c826de3d07f81297aa17f74d8271ea (diff)
[FIX] P3: urllib, urllib2 and urlparse
In Python 3, all of these were "consolidated" under urllib(.request, .parse, .errors) which is inconvenient. Since we already have hard dependencies on requests and werkzeug(.urls, which is a backport of Python 3's unicode-aware urllib.parse) migrate *everything* to that. A sticking point is urllib2.URLError, those were (mostly) replaced by the slightly more general IOError which URLError extends.
Diffstat (limited to 'addons/payment_authorize/controllers/main.py')
-rw-r--r--addons/payment_authorize/controllers/main.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/addons/payment_authorize/controllers/main.py b/addons/payment_authorize/controllers/main.py
index d88a74554b9..b42efe817bb 100644
--- a/addons/payment_authorize/controllers/main.py
+++ b/addons/payment_authorize/controllers/main.py
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
import pprint
import logging
-import urlparse
-import werkzeug
+from werkzeug import urls, utils
from odoo import http
from odoo.http import request
@@ -29,7 +28,7 @@ class AuthorizeController(http.Controller):
# This response is in the form of a URL that Authorize.Net will pass on to the
# client's browser to redirect them to the desired location need javascript.
return request.render('payment_authorize.payment_authorize_redirect', {
- 'return_url': '%s' % urlparse.urljoin(base_url, return_url)
+ 'return_url': urls.url_join(base_url, return_url)
})
@http.route(['/payment/authorize/s2s/create_json'], type='json', auth='public')
@@ -43,4 +42,4 @@ class AuthorizeController(http.Controller):
acquirer_id = int(post.get('acquirer_id'))
acquirer = request.env['payment.acquirer'].browse(acquirer_id)
acquirer.s2s_process(post)
- return werkzeug.utils.redirect(post.get('return_url', '/'))
+ return utils.redirect(post.get('return_url', '/'))