plainx-sentry 0.7.0__py3-none-any.whl → 0.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
plainx/sentry/templates.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import sentry_sdk
|
|
2
|
+
from plain.auth import get_request_user
|
|
2
3
|
from plain.runtime import settings
|
|
3
4
|
from plain.templates import register_template_extension
|
|
4
5
|
from plain.templates.jinja.extensions import InclusionTagExtension
|
|
@@ -25,8 +26,8 @@ class SentryJSExtension(InclusionTagExtension):
|
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
if "request" in context:
|
|
28
|
-
#
|
|
29
|
-
user =
|
|
29
|
+
# Get the authenticated user from the request
|
|
30
|
+
user = get_request_user(context["request"])
|
|
30
31
|
else:
|
|
31
32
|
# Get user directly if no request (like in server error context)
|
|
32
33
|
user = context.get("user", None)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plainx-sentry
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
4
4
|
Author-email: Dave Gaeddert <dave.gaeddert@gmail.com>
|
|
5
5
|
Requires-Python: >=3.11
|
|
6
6
|
Requires-Dist: sentry-sdk[opentelemetry]>=2.24.0
|
|
@@ -20,12 +20,6 @@ INSTALLED_PACKAGES = [
|
|
|
20
20
|
# ...
|
|
21
21
|
"plainx.sentry",
|
|
22
22
|
]
|
|
23
|
-
|
|
24
|
-
MIDDLEWARE = [
|
|
25
|
-
# Put SentryMiddleware as early as possible in the middleware stack
|
|
26
|
-
"plainx.sentry.SentryMiddleware",
|
|
27
|
-
# ...
|
|
28
|
-
]
|
|
29
23
|
```
|
|
30
24
|
|
|
31
25
|
In your `base.html`, load `sentry` and include the `sentry_js` tag:
|
|
@@ -2,8 +2,8 @@ plainx/sentry/CHANGELOG.md,sha256=kE1atfmZkThPdQ5fS7yylRMc_REJXel9zLjrDNgiGoc,37
|
|
|
2
2
|
plainx/sentry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
plainx/sentry/config.py,sha256=mtA9uyFtXgGqaUI-wraG06klKA5fNzTKunS2DNm1KK8,1573
|
|
4
4
|
plainx/sentry/default_settings.py,sha256=DNX6OQ0-BqfjyWuszW7JnZhiDn0tGtS3Fa2W7VbTIF8,564
|
|
5
|
-
plainx/sentry/templates.py,sha256=
|
|
5
|
+
plainx/sentry/templates.py,sha256=5dR1CwYfftnkzBan46sNHaHGu-ydQzrAhV9n_L9bb5k,2053
|
|
6
6
|
plainx/sentry/templates/sentry/js.html,sha256=aOjWAwuUaecGbC-5yZWP1aaGyYAcM-GK0dru-4VOYoE,491
|
|
7
|
-
plainx_sentry-0.
|
|
8
|
-
plainx_sentry-0.
|
|
9
|
-
plainx_sentry-0.
|
|
7
|
+
plainx_sentry-0.8.0.dist-info/METADATA,sha256=oCOW9dxdvS4ESNc9ME0rc2vVgr8243z5mnQKvvb-1qE,1442
|
|
8
|
+
plainx_sentry-0.8.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
9
|
+
plainx_sentry-0.8.0.dist-info/RECORD,,
|
|
File without changes
|