diff --git a/sentry/const.py b/sentry/const.py index e1829ebb0..c3135a9df 100644 --- a/sentry/const.py +++ b/sentry/const.py @@ -2,7 +2,6 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import collections import logging -import warnings from sentry_sdk import HttpTransport from sentry_sdk.consts import DEFAULT_OPTIONS @@ -61,11 +60,6 @@ DEFAULT_TRANSPORT = "threaded" def select_transport(name=DEFAULT_TRANSPORT): - warnings.warn( - "`sentry_transport` has been deprecated. " - "Its not neccesary send it, will use `HttpTranport` by default.", - DeprecationWarning, - ) return { "threaded": HttpTransport, }.get(name, HttpTransport) diff --git a/sentry/hooks.py b/sentry/hooks.py index 8539d5a18..789f93239 100644 --- a/sentry/hooks.py +++ b/sentry/hooks.py @@ -2,6 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import logging +import warnings from collections import abc import odoo.http @@ -73,6 +74,12 @@ def initialize_sentry(config): "Both sentry_odoo_dir and \ sentry_release defined, choosing sentry_release" ) + if config.get("sentry_transport"): + warnings.warn( + "`sentry_transport` has been deprecated. " + "Its not neccesary send it, will use `HttpTranport` by default.", + DeprecationWarning, + ) options = {} for option in const.get_sentry_options(): value = config.get("sentry_%s" % option.key, option.default)