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