[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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user