lingo: return early if transaction status didn't change (#22022)

This commit is contained in:
Frédéric Péters 2018-02-21 09:12:17 +01:00
parent 6eba54171f
commit de65efc33b
1 changed files with 7 additions and 1 deletions

View File

@ -434,8 +434,14 @@ class PaymentView(View):
logger.info(u'received known payment response with id %s',
smart_text(payment_response.order_id), extra=extra_info)
if transaction.status == payment_response.result:
# return early if transaction status didn't change (it means the
# payment service sent the response both as server to server and
# via the user browser and we already handled one).
return transaction
if transaction.status and transaction.status != payment_response.result:
logger.warning(u'received payment notification on existing transaction '
logger.info(u'received payment notification on existing transaction '
'(status: %s, new status: %s)' % (
transaction.status, payment_response.result))