From 4014563e3fcd4e206655745481dfc0a45fd8a7ae Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Wed, 3 Aug 2016 09:42:38 +0200 Subject: [PATCH] [FIX] website_payment: stop treating _registration_render result as a list I assume this was necessary before the migration of payment because an api.one wrapper was added by the auto-guess api feature. Since payment has been migrated, this decorator is no longer present and the result of _registration_render is no longer encapsulated in a list. Therefore, taking the zeroth element was akin to taking only the first character of the rendered html. Usually \n, which is not useful but which also prevented the crash to be easily visible. --- addons/website_payment/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_payment/controllers/main.py b/addons/website_payment/controllers/main.py index a3487e5052d..afcc77e9ff9 100644 --- a/addons/website_payment/controllers/main.py +++ b/addons/website_payment/controllers/main.py @@ -16,7 +16,7 @@ class website_payment(http.Controller): 'acquirers': acquirers } for acquirer in acquirers: - acquirer.form = acquirer.sudo()._registration_render(request.env.user.partner_id.id, {'error': {}, 'error_message': [], 'return_url': '/my/payment_method', 'json': False, 'bootstrap_formatting': True})[0] + acquirer.form = acquirer.sudo()._registration_render(request.env.user.partner_id.id, {'error': {}, 'error_message': [], 'return_url': '/my/payment_method', 'json': False, 'bootstrap_formatting': True}) return request.website.render("website_payment.pay_methods", values) @http.route(['/website_payment/delete/'], methods=['POST'], type='http', auth="user", website=True)