From f9cbefac41dcbc22001cc3dff3ec5209cdd2f303 Mon Sep 17 00:00:00 2001 From: Clara Dantas Date: Mon, 27 Jul 2020 22:13:14 -0300 Subject: [PATCH] sentry: Add user role in user_info object. As part of issue #15344, the error report emails add the user role information. This commit adds the user role information to be used by sentry as well. --- zproject/sentry.py | 1 + 1 file changed, 1 insertion(+) diff --git a/zproject/sentry.py b/zproject/sentry.py index 9a2a03bb84..bae8bc4da3 100644 --- a/zproject/sentry.py +++ b/zproject/sentry.py @@ -19,6 +19,7 @@ def add_context(event: 'Event', hint: 'Hint') -> 'Event': if user_info.get("id"): user_profile = get_user_profile_by_id(user_info["id"]) user_info["realm"] = user_profile.realm.string_id or 'root' + user_info["role"] = user_profile.get_role_name() return event def setup_sentry(dsn: Optional[str], *integrations: Integration) -> None: