feat: Enhance Python environment setup with system Python option and improve dependency installation
Some checks failed
Run Tests / e2e tests (push) Failing after 50s
Run Tests / lint tests (push) Failing after 1m53s
Run Tests / unit tests (push) Failing after 2m25s

refactor: Clean up imports in currencies and users routes
fix: Update theme settings saving logic and clean up test imports
This commit is contained in:
2025-10-27 18:39:20 +01:00
parent 7385bdad3e
commit 54137b88d7
8 changed files with 42 additions and 26 deletions

View File

@@ -3,9 +3,15 @@ from sqlalchemy.orm import Session
from config.database import get_db
from models.user import User
from services.security import get_password_hash, verify_password, create_access_token, SECRET_KEY, ALGORITHM, get_current_user, oauth2_scheme
from jose import jwt, JWTError
from schemas.user import UserCreate, UserInDB, UserLogin, UserUpdate, PasswordResetRequest, PasswordReset, Token
from services.security import create_access_token, get_current_user
from schemas.user import (
PasswordReset,
PasswordResetRequest,
UserCreate,
UserInDB,
UserLogin,
UserUpdate,
)
router = APIRouter(prefix="/users", tags=["users"])
@@ -62,7 +68,7 @@ async def update_user_me(user_update: UserUpdate, current_user: User = Depends(g
if existing_user:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST, detail="Username already taken")
current_user.username = user_update.username
setattr(current_user, "username", user_update.username)
if user_update.email and user_update.email != current_user.email:
existing_user = db.query(User).filter(
@@ -70,7 +76,7 @@ async def update_user_me(user_update: UserUpdate, current_user: User = Depends(g
if existing_user:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST, detail="Email already registered")
current_user.email = user_update.email
setattr(current_user, "email", user_update.email)
if user_update.password:
current_user.set_password(user_update.password)