Skip to content

Commit

Permalink
fix(sentry): set the user's name correctly
Browse files Browse the repository at this point in the history
https://docs.sentry.io/platforms/python/enriching-events/identify-user/

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit faef64b)
  • Loading branch information
akhilnarang authored and mergify[bot] committed Dec 8, 2023
1 parent 75d7827 commit 859fd74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frappe/utils/sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def capture_exception(
evt_processor = _make_wsgi_event_processor(frappe.request.environ, False)
scope.add_event_processor(evt_processor)
scope.set_tag("site", frappe.local.site)
scope.set_tag("user", getattr(frappe.session, "user", "Unidentified"))
scope.set_user({"name": getattr(frappe.session, "user", "Unidentified")})

# Extract `X-Frappe-Request-ID` to store as a separate field if its present
if trace_id := frappe.monitor.get_trace_id():
Expand Down

0 comments on commit 859fd74

Please sign in to comment.