summaryrefslogtreecommitdiff
path: root/addons/payment_sips
diff options
context:
space:
mode:
authorDamien Bouvy <dbo@odoo.com>2020-04-08 05:55:29 +0000
committerDamien Bouvy <dbo@odoo.com>2020-04-09 14:07:07 +0000
commitf023d89dba3fe5517b4a09144be6a66e06b3c101 (patch)
tree2c115ce4252b7208b404dd3da05acd46f88de81d /addons/payment_sips
parent0ef83a729cd5829c257fcd0532a4e5d5fbb99fab (diff)
[FIX] payment_sips: stop log pollution
SIPS sometimes send empty notifications. I have been unable to find out why or to reproduce the issue; it seems to be linked to a delay on their end since these notifications usually arrive after a customer is redirected back to Odoo (at least on their test account). I'd rather log a warning for those cases (since nothing is wrong on Odoo's side, there's just no info to act upon) instead of a full traceback. closes odoo/odoo#49335 X-original-commit: 100ef1bdb7b90edbeccfa6cd10297acb824b8083 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/payment_sips')
-rw-r--r--addons/payment_sips/controllers/main.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/addons/payment_sips/controllers/main.py b/addons/payment_sips/controllers/main.py
index 0bbb4ccabc2..6f268170485 100644
--- a/addons/payment_sips/controllers/main.py
+++ b/addons/payment_sips/controllers/main.py
@@ -32,7 +32,13 @@ class SipsController(http.Controller):
def sips_ipn(self, **post):
""" Sips IPN. """
_logger.info('Beginning Sips IPN form_feedback with post data %s', pprint.pformat(post)) # debug
- self.sips_validate_data(**post)
+ if not post:
+ # SIPS sometimes send empty notification, the reason why is
+ # unclear but they tend to pollute logs and do not provide any
+ # meaningful information; log as a warning instead of a traceback
+ _logger.warning('Sips: received empty notification; skip.')
+ else:
+ self.sips_validate_data(**post)
return ''
@http.route([