details: https://code.tryton.org/tryton/commit/58b585fad07d
branch: default
user: Cédric Krier <[email protected]>
date: Sat Jan 03 14:05:34 2026 +0100
description:
Defer importing the stripe module only if the webhook is called
diffstat:
modules/account_payment_stripe/routes.py | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diffs (20 lines):
diff -r 387fe8205c80 -r 58b585fad07d modules/account_payment_stripe/routes.py
--- a/modules/account_payment_stripe/routes.py Sat Jan 03 14:05:07 2026 +0100
+++ b/modules/account_payment_stripe/routes.py Sat Jan 03 14:05:34 2026 +0100
@@ -4,8 +4,6 @@
import json
import logging
-import stripe
-
from trytond.protocols.wrappers import (
HTTPStatus, Response, abort, with_pool, with_transaction)
from trytond.wsgi import app
@@ -83,6 +81,7 @@
@with_pool
@with_transaction(context={'_skip_warnings': True})
def webhooks_endpoint(request, pool, account):
+ import stripe
Account = pool.get('account.payment.stripe.account')
account, = Account.search([
('webhook_identifier', '=', account),