Skip to content

Commit 3266554

Browse files
Improvements for fastapi (#45)
1 parent 001f6e6 commit 3266554

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/tidewave/middleware.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ def __call__(self, environ: dict[str, Any], start_response: Callable):
6262
else:
6363
full_path = path_info
6464

65+
full_path = full_path.rstrip("/")
66+
6567
if full_path.startswith("/tidewave"):
6668
security_error = self._check_security(environ)
6769
if security_error:

src/tidewave/sqlalchemy/models.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@ def get_models() -> str:
2121
if model is base_class:
2222
continue
2323

24-
# Check if it's an abstract model (has __abstract__ = True)
25-
if getattr(model, "__abstract__", False):
24+
# Check if it's an abstract model (has __abstract__ = True).
25+
# Note that we check the dict instead of using getattr,
26+
# so that we check the attribute on the specific model,
27+
# otherwise we may access the attribute inherited from
28+
# parent.
29+
if model.__dict__.get("__abstract__", False):
2630
continue
2731

2832
# Check if it has any columns (indicating it's a concrete model)

0 commit comments

Comments
 (0)