plain.auth 0.20.3__tar.gz → 0.20.5__tar.gz
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.
- {plain_auth-0.20.3 → plain_auth-0.20.5}/PKG-INFO +1 -1
- {plain_auth-0.20.3 → plain_auth-0.20.5}/plain/auth/CHANGELOG.md +20 -0
- {plain_auth-0.20.3 → plain_auth-0.20.5}/plain/auth/templates.py +6 -1
- {plain_auth-0.20.3 → plain_auth-0.20.5}/pyproject.toml +3 -3
- {plain_auth-0.20.3 → plain_auth-0.20.5}/.gitignore +0 -0
- {plain_auth-0.20.3 → plain_auth-0.20.5}/LICENSE +0 -0
- {plain_auth-0.20.3 → plain_auth-0.20.5}/README.md +0 -0
- {plain_auth-0.20.3 → plain_auth-0.20.5}/plain/auth/README.md +0 -0
- {plain_auth-0.20.3 → plain_auth-0.20.5}/plain/auth/__init__.py +0 -0
- {plain_auth-0.20.3 → plain_auth-0.20.5}/plain/auth/default_settings.py +0 -0
- {plain_auth-0.20.3 → plain_auth-0.20.5}/plain/auth/requests.py +0 -0
- {plain_auth-0.20.3 → plain_auth-0.20.5}/plain/auth/sessions.py +0 -0
- {plain_auth-0.20.3 → plain_auth-0.20.5}/plain/auth/test.py +0 -0
- {plain_auth-0.20.3 → plain_auth-0.20.5}/plain/auth/utils.py +0 -0
- {plain_auth-0.20.3 → plain_auth-0.20.5}/plain/auth/views.py +0 -0
- {plain_auth-0.20.3 → plain_auth-0.20.5}/tests/app/settings.py +0 -0
- {plain_auth-0.20.3 → plain_auth-0.20.5}/tests/app/urls.py +0 -0
- {plain_auth-0.20.3 → plain_auth-0.20.5}/tests/app/users/migrations/0001_initial.py +0 -0
- {plain_auth-0.20.3 → plain_auth-0.20.5}/tests/app/users/migrations/__init__.py +0 -0
- {plain_auth-0.20.3 → plain_auth-0.20.5}/tests/app/users/models.py +0 -0
- {plain_auth-0.20.3 → plain_auth-0.20.5}/tests/test_views.py +0 -0
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# plain-auth changelog
|
|
2
2
|
|
|
3
|
+
## [0.20.5](https://github.com/dropseed/plain/releases/plain-auth@0.20.5) (2025-10-20)
|
|
4
|
+
|
|
5
|
+
### What's changed
|
|
6
|
+
|
|
7
|
+
- Updated `pyproject.toml` to use standard `[dependency-groups]` format instead of uv-specific `[tool.uv]` section for development dependencies ([1b43a3a](https://github.com/dropseed/plain/commit/1b43a3a272))
|
|
8
|
+
|
|
9
|
+
### Upgrade instructions
|
|
10
|
+
|
|
11
|
+
- No changes required
|
|
12
|
+
|
|
13
|
+
## [0.20.4](https://github.com/dropseed/plain/releases/plain-auth@0.20.4) (2025-10-16)
|
|
14
|
+
|
|
15
|
+
### What's changed
|
|
16
|
+
|
|
17
|
+
- The `get_current_user()` template function now catches `SessionNotAvailable` exceptions and returns `None`, preventing errors during error page rendering before middleware runs ([fb889fa](https://github.com/dropseed/plain/commit/fb889fa0e9))
|
|
18
|
+
|
|
19
|
+
### Upgrade instructions
|
|
20
|
+
|
|
21
|
+
- No changes required
|
|
22
|
+
|
|
3
23
|
## [0.20.3](https://github.com/dropseed/plain/releases/plain-auth@0.20.3) (2025-10-07)
|
|
4
24
|
|
|
5
25
|
### What's changed
|
|
@@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any
|
|
|
4
4
|
|
|
5
5
|
from jinja2 import pass_context
|
|
6
6
|
|
|
7
|
+
from plain.sessions.exceptions import SessionNotAvailable
|
|
7
8
|
from plain.templates import register_template_global
|
|
8
9
|
|
|
9
10
|
from .requests import get_request_user
|
|
@@ -18,4 +19,8 @@ def get_current_user(context: Context) -> Any | None:
|
|
|
18
19
|
"""Get the authenticated user for the current request."""
|
|
19
20
|
request = context.get("request")
|
|
20
21
|
assert request is not None, "No request in template context"
|
|
21
|
-
|
|
22
|
+
try:
|
|
23
|
+
return get_request_user(request)
|
|
24
|
+
except SessionNotAvailable:
|
|
25
|
+
# Session not available (e.g., during error page rendering before middleware runs)
|
|
26
|
+
return None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "plain.auth"
|
|
3
|
-
version = "0.20.
|
|
3
|
+
version = "0.20.5"
|
|
4
4
|
description = "Add users to your app and decide what they can access."
|
|
5
5
|
authors = [{name = "Dave Gaeddert", email = "dave.gaeddert@dropseed.dev"}]
|
|
6
6
|
readme = "README.md"
|
|
@@ -13,8 +13,8 @@ dependencies = [
|
|
|
13
13
|
"plain.sessions<1.0.0",
|
|
14
14
|
]
|
|
15
15
|
|
|
16
|
-
[
|
|
17
|
-
dev
|
|
16
|
+
[dependency-groups]
|
|
17
|
+
dev = [
|
|
18
18
|
"plain.pytest<1.0.0",
|
|
19
19
|
]
|
|
20
20
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|