Skip to content

Commit 15cf625

Browse files
committed
Refactored to not change the default value of send_default_pii
1 parent 7911570 commit 15cf625

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

sentry_sdk/client.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,7 @@ def _get_options(*args, **kwargs):
128128
rv["traces_sample_rate"] = 1.0
129129

130130
if rv["event_scrubber"] is None:
131-
rv["event_scrubber"] = EventScrubber(
132-
send_default_pii=(
133-
False if rv["send_default_pii"] is None else rv["send_default_pii"]
134-
)
135-
)
131+
rv["event_scrubber"] = EventScrubber(send_default_pii=rv["send_default_pii"])
136132

137133
if rv["socket_options"] and not isinstance(rv["socket_options"], list):
138134
logger.warning(
@@ -455,9 +451,10 @@ def should_send_default_pii(self):
455451
456452
Returns whether the client should send default PII (Personally Identifiable Information) data to Sentry.
457453
"""
458-
result = self.options.get("send_default_pii")
459-
if result is None:
460-
result = not self.options["dsn"] and self.spotlight is not None
454+
result = self.options.get("send_default_pii", False)
455+
456+
if not self.options["dsn"] and self.spotlight is not None:
457+
result = True
461458

462459
return result
463460

sentry_sdk/consts.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ def __init__(
507507
transport=None, # type: Optional[Union[sentry_sdk.transport.Transport, Type[sentry_sdk.transport.Transport], Callable[[Event], None]]]
508508
transport_queue_size=DEFAULT_QUEUE_SIZE, # type: int
509509
sample_rate=1.0, # type: float
510-
send_default_pii=None, # type: Optional[bool]
510+
send_default_pii=False, # type: bool
511511
http_proxy=None, # type: Optional[str]
512512
https_proxy=None, # type: Optional[str]
513513
ignore_errors=[], # type: Sequence[Union[type, str]] # noqa: B006

0 commit comments

Comments
 (0)