Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved should_send_default_pii into client #2840

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions sentry_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,15 @@ def is_active(self):
"""
return True

def should_send_default_pii(self):
# type: () -> bool
"""
.. versionadded:: 2.0.0

Returns whether the client should send default PII (Personally Identifiable Information) data to Sentry.
"""
return self.options.get("send_default_pii", False)

@property
def dsn(self):
# type: () -> Optional[str]
Expand Down
4 changes: 3 additions & 1 deletion sentry_sdk/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ def overload(x):

def _should_send_default_pii():
# type: () -> bool
# TODO: Migrate existing code to client.should_send_default_pii() and remove this function.
# New code should not use this function!
client = Hub.current.client
if not client:
return False
return client.options["send_default_pii"]
return client.should_send_default_pii()


class _InitGuard:
Expand Down