Skip to content

Commit 42939c2

Browse files
committed
fix pylint issues
1 parent ac79ccb commit 42939c2

3 files changed

Lines changed: 26 additions & 4 deletions

File tree

backend/app/routes/auth_routes.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88

99
router = APIRouter(prefix="/auth", tags=["Authentication"])
1010

11-
@router.post("/login", response_model=LoginResponse, status_code=status.HTTP_200_OK, summary="Authenticate a user and return JWT tokens")
11+
@router.post(
12+
"/login",
13+
response_model=LoginResponse,
14+
status_code=status.HTTP_200_OK,
15+
summary="Authenticate a user and return JWT tokens"
16+
)
1217
def login(request: LoginRequest, db: Session = Depends(get_db)):
1318
"""Authenticate a user and return access plus refresh tokens."""
1419

@@ -21,7 +26,12 @@ def login(request: LoginRequest, db: Session = Depends(get_db)):
2126
user=UserResponse.model_validate(user)
2227
)
2328

24-
@router.post("/refresh", response_model=RefreshResponse, status_code=status.HTTP_200_OK, summary="Generate a new access token using a refresh token")
29+
@router.post(
30+
"/refresh",
31+
response_model=RefreshResponse,
32+
status_code=status.HTTP_200_OK,
33+
summary="Generate a new access token using a refresh token"
34+
)
2535
def refresh_access_token(request: RefreshRequest):
2636
"""Validate a refresh token and return a new access token."""
2737

backend/app/routes/user_routes.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,25 @@
99
router = APIRouter(prefix="/users", tags=["Users"])
1010

1111

12-
@router.post("/", response_model=UserResponse, status_code=status.HTTP_201_CREATED, summary="Create a new user")
12+
@router.post(
13+
"/",
14+
response_model=UserResponse,
15+
status_code=status.HTTP_201_CREATED,
16+
summary="Create a new user"
17+
)
1318
def create_user(request: UserCreate, db: Session = Depends(get_db)):
1419
"""Create a new user."""
1520

1621
user = UserService.create_user(db, request.username)
1722
return UserResponse.model_validate(user)
1823

1924

20-
@router.get("/me", response_model=UserResponse, status_code=status.HTTP_200_OK, summary="Get the current user's profile")
25+
@router.get(
26+
"/me",
27+
response_model=UserResponse,
28+
status_code=status.HTTP_200_OK,
29+
summary="Get the current user's profile"
30+
)
2131
def get_current_user_profile(
2232
current_username: str = Depends(get_current_user),
2333
db: Session = Depends(get_db),

backend/app/schemas/user_dto.py

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

33

44
class UserCreate(BaseModel):
5+
"""Request to create a new user."""
6+
57
username: str
68

79
class UserResponse(BaseModel):

0 commit comments

Comments
 (0)