Skip to content

Commit 0ffae1f

Browse files
🎨 Auto format and update with pre-commit
1 parent e0c9b0a commit 0ffae1f

File tree

11 files changed

+464
-258
lines changed

11 files changed

+464
-258
lines changed

backend/app/api/routes/notifications.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ def read_notifications(
3535
count_statement = count_statement.where(Notification.is_read == False)
3636
count = session.exec(count_statement).one()
3737

38-
unread_count_statement = select(func.count()).select_from(Notification).where(
39-
Notification.is_read == False
38+
unread_count_statement = (
39+
select(func.count())
40+
.select_from(Notification)
41+
.where(Notification.is_read == False)
4042
)
4143
unread_count = session.exec(unread_count_statement).one()
4244

@@ -104,7 +106,10 @@ def read_notification(
104106

105107
@router.post("/", response_model=NotificationPublic)
106108
async def create_notification(
107-
*, session: SessionDep, current_user: CurrentUser, notification_in: NotificationCreate
109+
*,
110+
session: SessionDep,
111+
current_user: CurrentUser,
112+
notification_in: NotificationCreate,
108113
) -> Any:
109114
"""
110115
Create new notification.
@@ -113,7 +118,8 @@ async def create_notification(
113118
"""
114119
if not current_user.is_superuser and notification_in.user_id != current_user.id:
115120
raise HTTPException(
116-
status_code=403, detail="Not enough permissions to create notifications for other users"
121+
status_code=403,
122+
detail="Not enough permissions to create notifications for other users",
117123
)
118124

119125
notification = Notification.model_validate(notification_in)

backend/app/api/routes/websocket.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
import logging
22
from typing import Annotated
3-
from uuid import UUID
43

54
import jwt
6-
from fastapi import APIRouter, Depends, HTTPException, Query, WebSocket, WebSocketDisconnect, status
5+
from fastapi import (
6+
APIRouter,
7+
HTTPException,
8+
Query,
9+
WebSocket,
10+
WebSocketDisconnect,
11+
status,
12+
)
713
from jwt.exceptions import InvalidTokenError
814
from pydantic import ValidationError
915
from sqlmodel import Session

backend/app/core/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ def all_cors_origins(self) -> list[str]:
6363
@property
6464
def SQLALCHEMY_DATABASE_URI(self) -> str:
6565
if self.USE_SQLITE:
66-
db_path = os.path.join(os.path.dirname(__file__), "..", "..", self.SQLITE_DATABASE)
66+
db_path = os.path.join(
67+
os.path.dirname(__file__), "..", "..", self.SQLITE_DATABASE
68+
)
6769
return f"sqlite:///{os.path.abspath(db_path)}"
6870
return str(
6971
PostgresDsn.build(

backend/app/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import sentry_sdk
21
from contextlib import asynccontextmanager
32

3+
import sentry_sdk
44
from fastapi import FastAPI
55
from fastapi.routing import APIRoute
66
from sqlmodel import Session

backend/app/models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ class User(UserBase, table=True):
5555
sa_type=DateTime(timezone=True), # type: ignore
5656
)
5757
items: list["Item"] = Relationship(back_populates="owner", cascade_delete=True)
58-
notifications: list["Notification"] = Relationship(back_populates="user", cascade_delete=True)
58+
notifications: list["Notification"] = Relationship(
59+
back_populates="user", cascade_delete=True
60+
)
5961

6062

6163
# Properties to return via API, id is always required

frontend/src/client/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ export { ApiError } from './core/ApiError';
33
export { CancelablePromise, CancelError } from './core/CancelablePromise';
44
export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI';
55
export * from './sdk.gen';
6-
export * from './types.gen';
7-
// Custom notifications module (manually added)
8-
export * from './notifications.gen';
6+
export * from './types.gen';

frontend/src/client/notifications.gen.ts

Lines changed: 0 additions & 234 deletions
This file was deleted.

0 commit comments

Comments
 (0)