Skip to content

Commit 8614c57

Browse files
committed
Final polish?
1 parent 409f1d4 commit 8614c57

File tree

6 files changed

+58
-63
lines changed

6 files changed

+58
-63
lines changed

backend/app/api/routes/items.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Item management API endpoints."""
22

33
import uuid
4-
from mailbox import Message
54

65
from fastapi import APIRouter, HTTPException
76
from sqlmodel import func, select
@@ -10,7 +9,7 @@
109
from app.constants import BAD_REQUEST_CODE, NOT_FOUND_CODE
1110

1211
# Removed unused Any import
13-
from app.models import Item, ItemCreate, ItemPublic, ItemsPublic, ItemUpdate
12+
from app.models import Item, ItemCreate, ItemPublic, ItemsPublic, ItemUpdate, Message
1413

1514
router = APIRouter(prefix="/items", tags=["items"])
1615

backend/app/core/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,16 @@ class Settings(BaseSettings): # type: ignore[explicit-any]
7878
FIRST_SUPERUSER: EmailStr
7979
FIRST_SUPERUSER_PASSWORD: str
8080

81+
@computed_field # type: ignore[prop-decorator]
8182
@property
82-
@computed_field
8383
def all_cors_origins(self) -> list[str]:
8484
"""Get all CORS origins."""
8585
return [str(origin).rstrip("/") for origin in self.BACKEND_CORS_ORIGINS] + [
8686
self.FRONTEND_HOST,
8787
]
8888

89+
@computed_field # type: ignore[prop-decorator]
8990
@property
90-
@computed_field
9191
def SQLALCHEMY_DATABASE_URI(self) -> PostgresDsn: # noqa: N802
9292
"""Build database URI from configuration."""
9393
return PostgresDsn.build(
@@ -99,8 +99,8 @@ def SQLALCHEMY_DATABASE_URI(self) -> PostgresDsn: # noqa: N802
9999
path=self.POSTGRES_DB,
100100
)
101101

102+
@computed_field # type: ignore[prop-decorator]
102103
@property
103-
@computed_field
104104
def emails_enabled(self) -> bool:
105105
"""Check if email configuration is enabled."""
106106
return bool(self.SMTP_HOST and self.EMAILS_FROM_EMAIL)

backend/app/models/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
UserUpdateMe,
3232
)
3333

34-
__all__ = [ # noqa: RUF022
34+
__all__ = [
3535
# API models
3636
"Message",
3737
"NewPassword",

backend/app/models/db_models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ class Item(SQLModel, table=True):
3232
ondelete="CASCADE",
3333
)
3434
owner: User | None = Relationship(back_populates="item_list")
35+
36+

code_quality_analysis.ipynb

Lines changed: 50 additions & 57 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ ignore = [
101101
"D103", # Ignore missing docstrings in tests
102102
"D100", # Ignore missing docstrings in public modules
103103
]
104+
"backend/app/models/__init__.py" = ["RUF022"]
104105

105106
[tool.bandit]
106107
exclude_dirs = ["app/tests"]

0 commit comments

Comments
 (0)