Skip to content

Commit 8e99cb6

Browse files
authored
Merge branch 'main' into feature/sqladmin-912_perform_template_context
2 parents 91f1a91 + a3f24b5 commit 8e99cb6

9 files changed

Lines changed: 20 additions & 14 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Main features include:
3939

4040
---
4141

42-
**Documentation**: [https://aminalaee.dev/sqladmin](https://aminalaee.dev/sqladmin)
42+
**Documentation**: [https://aminalaee.github.io/sqladmin](https://aminalaee.github.io/sqladmin)
4343

4444
**Source Code**: [https://github.com/aminalaee/sqladmin](https://github.com/aminalaee/sqladmin)
4545

docs/authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The class `AuthenticationBackend` has three methods you need to override:
1010

1111
* `authenticate`: Will be called for validating each incoming request.
1212
* `login`: Will be called only in the login page to validate username/password.
13-
* `logout`: Will be called only for the logout, usually clearin the session.
13+
* `logout`: Will be called only for the logout, usually clearing the session.
1414

1515
```python
1616
from sqladmin import Admin

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Main features include:
3939

4040
---
4141

42-
**Documentation**: [https://aminalaee.dev/sqladmin](https://aminalaee.dev/sqladmin)
42+
**Documentation**: [https://aminalaee.github.io/sqladmin](https://aminalaee.github.io/sqladmin)
4343

4444
**Source Code**: [https://github.com/aminalaee/sqladmin](https://github.com/aminalaee/sqladmin)
4545

docs/model_convertors.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
Model Converters are special classes used to convert SQLAlchemy model properties into web interface form fields. They allow you to customize how backend SQLAlchemy models are represented in the admin interface, providing flexibility in handling different data types and validation rules.
66

7-
This page will guide you through the basics of using and customizing Model Converters. For advanced usage, refer to the [API Reference](./api_reference/model_converter.md).
8-
97
---
108

119
## Overview

docs/working_with_files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ and displayed in the admin dashboard.
5757

5858
You can replace `FileSystemStorage` with `S3Storage` to upload to S3 or any S3-compatible API.
5959

60-
For complete features and API reference of the `fastapi-storages` you can visit the docs at [https://aminalaee.dev/fastapi-storages](https://aminalaee.dev/fastapi-storages).
60+
For complete features and API reference of the `fastapi-storages` you can visit the docs at [https://aminalaee.github.io/fastapi-storages](https://aminalaee.github.io/fastapi-storages).

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
site_name: SQLAlchemy Admin
22
site_description: Flexible admin dashboard for SQLAlchemy.
3-
site_url: https://aminalaee.dev/sqladmin
3+
site_url: https://aminalaee.github.io/sqladmin/
44

55
theme:
66
name: "material"

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ full = [
4141
]
4242

4343
[project.urls]
44-
Documentation = "https://aminalaee.dev/sqladmin"
44+
Documentation = "https://aminalaee.github.io/sqladmin/"
4545
Issues = "https://github.com/aminalaee/sqladmin/issues"
4646
Source = "https://github.com/aminalaee/sqladmin"
4747

@@ -93,9 +93,9 @@ dependencies = [
9393

9494
[tool.hatch.envs.docs]
9595
dependencies = [
96-
"mkdocs-material==9.1.3",
97-
"mkdocs==1.4.2",
98-
"mkdocstrings[python]==0.25.0",
96+
"mkdocs-material==9.6.14",
97+
"mkdocs==1.6.1",
98+
"mkdocstrings[python]==0.26.1",
9999
]
100100

101101
[tool.hatch.envs.test.scripts]

sqladmin/application.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,11 @@ async def login(self, request: Request) -> Response:
644644
async def logout(self, request: Request) -> Response:
645645
assert self.authentication_backend is not None
646646

647-
await self.authentication_backend.logout(request)
647+
response = await self.authentication_backend.logout(request)
648+
649+
if isinstance(response, Response):
650+
return response
651+
648652
return RedirectResponse(request.url_for("admin:index"), status_code=302)
649653

650654
async def ajax_lookup(self, request: Request) -> Response:

sqladmin/authentication.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,13 @@ async def login(self, request: Request) -> bool:
2929
"""
3030
raise NotImplementedError()
3131

32-
async def logout(self, request: Request) -> bool:
32+
async def logout(self, request: Request) -> Response | bool:
3333
"""Implement logout logic here.
3434
This will usually clear the session with `request.session.clear()`.
35+
36+
If a `Response` or `RedirectResponse` is returned,
37+
that response is returned to the user,
38+
otherwise the user will be redirected to the index page.
3539
"""
3640
raise NotImplementedError()
3741

@@ -40,7 +44,7 @@ async def authenticate(self, request: Request) -> Response | bool:
4044
This method will be called for each incoming request
4145
to validate the authentication.
4246
43-
If a 'Response' or `RedirectResponse` is returned,
47+
If a `Response` or `RedirectResponse` is returned,
4448
that response is returned to the user,
4549
otherwise a True/False is expected.
4650
"""

0 commit comments

Comments
 (0)