From 00ea919699d0927604a21fdd5bc3974defad8317 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 3 Sep 2014 15:19:26 +0200 Subject: [PATCH] [FIX] payment_paypal: avoid json decode error with post.pop('custom', '{}'), if the key 'custom' is not there, it will return '{}', but if the key is there, but the value is equivalent to False, the json decode will fail. --- addons/payment_paypal/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/payment_paypal/controllers/main.py b/addons/payment_paypal/controllers/main.py index e07fa3d738f..94c8171da14 100644 --- a/addons/payment_paypal/controllers/main.py +++ b/addons/payment_paypal/controllers/main.py @@ -24,7 +24,7 @@ class PaypalController(http.Controller): """ Extract the return URL from the data coming from paypal. """ return_url = post.pop('return_url', '') if not return_url: - custom = json.loads(post.pop('custom', '{}')) + custom = json.loads(post.pop('custom', False) or '{}') return_url = custom.get('return_url', '/') return return_url