Skip to content

Commit efab959

Browse files
fix: fix lint errors in services.py
1 parent c7a1354 commit efab959

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

backend/src/auth/services.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717

1818
ALGORITHM = "HS256"
1919

20-
reusable_oauth2 = OAuth2PasswordBearer(
21-
tokenUrl=f"{settings.API_V1_STR}/tokens")
20+
reusable_oauth2 = OAuth2PasswordBearer(tokenUrl=f"{settings.API_V1_STR}/tokens")
2221
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
2322

2423
SessionDep = Annotated[Session, Depends(get_db)]
@@ -28,11 +27,9 @@
2827
def get_user_from_session(request: Request, session: SessionDep) -> User:
2928
session_user = request.session.get("user")
3029
if not session_user:
31-
raise HTTPException(status_code=401,
32-
detail="Not authenticated (no session)")
30+
raise HTTPException(status_code=401, detail="Not authenticated (no session)")
3331

34-
user = session.exec(select(User).where(
35-
User.email == session_user["email"])).first()
32+
user = session.exec(select(User).where(User.email == session_user["email"])).first()
3633
if not user or not user.is_active:
3734
raise HTTPException(status_code=401, detail="Invalid session user")
3835
return UserPublic.model_validate(user)

0 commit comments

Comments
 (0)