|
8 | 8 | RequestExtractor, |
9 | 9 | ) |
10 | 10 | from sentry_sdk.integrations.wsgi import SentryWsgiMiddleware |
11 | | -from sentry_sdk.scope import should_send_default_pii |
12 | 11 | from sentry_sdk.traces import SegmentNameSource |
13 | 12 | from sentry_sdk.utils import ( |
14 | 13 | capture_internal_exceptions, |
15 | 14 | ensure_integration_enabled, |
16 | 15 | event_from_exception, |
17 | | - has_data_collection_enabled, |
18 | 16 | package_version, |
19 | 17 | ) |
20 | 18 |
|
@@ -146,13 +144,7 @@ def _request_started(app: "Flask", **kwargs: "Any") -> None: |
146 | 144 |
|
147 | 145 | scope = sentry_sdk.get_isolation_scope() |
148 | 146 |
|
149 | | - if has_data_collection_enabled(client.options): |
150 | | - if client.options["data_collection"]["user_info"]: |
151 | | - with capture_internal_exceptions(): |
152 | | - user_properties = _get_flask_user_properties() |
153 | | - if user_properties: |
154 | | - scope.set_user(user_properties) |
155 | | - elif should_send_default_pii(): |
| 147 | + if client.options["data_collection"]["user_info"]: |
156 | 148 | with capture_internal_exceptions(): |
157 | 149 | user_properties = _get_flask_user_properties() |
158 | 150 | if user_properties: |
@@ -205,11 +197,7 @@ def inner(event: "Event", hint: "dict[str, Any]") -> "Event": |
205 | 197 | FlaskRequestExtractor(request).extract_into_event(event) |
206 | 198 |
|
207 | 199 | client_options = sentry_sdk.get_client().options |
208 | | - if has_data_collection_enabled(client_options): |
209 | | - if client_options["data_collection"]["user_info"]: |
210 | | - with capture_internal_exceptions(): |
211 | | - _add_user_to_event(event) |
212 | | - elif should_send_default_pii(): |
| 200 | + if client_options["data_collection"]["user_info"]: |
213 | 201 | with capture_internal_exceptions(): |
214 | 202 | _add_user_to_event(event) |
215 | 203 |
|
|
0 commit comments