Defer importing the braintree module only if the webhook is called

This commit is contained in:
Cédric Krier
2026-01-03 14:05:07 +01:00
parent 7b4eb14968
commit 809e805bc1
+1 -2
View File
@@ -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 @@ def checkout(request, pool, model, id):
@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),