debug: add logging to settings save to diagnose issue
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import logging
|
||||
import uuid
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, status
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
@@ -108,8 +111,10 @@ async def update_user_config(
|
||||
|
||||
# Merge updates
|
||||
update_data = data.model_dump(exclude_unset=True, exclude_none=True)
|
||||
logger.info("Updating user config for user %s: %s", user_id, update_data)
|
||||
config.config.update(update_data)
|
||||
|
||||
await session.commit()
|
||||
await session.refresh(config)
|
||||
logger.info("Updated config: %s", config.config)
|
||||
return UserConfigResponse.model_validate(config.config)
|
||||
|
||||
@@ -50,7 +50,9 @@ export const SettingsPage = () => {
|
||||
git_user_name: config.git_user_name ?? undefined,
|
||||
git_user_email: config.git_user_email ?? undefined,
|
||||
};
|
||||
console.log("Sending update:", update);
|
||||
const updated = await updateUserConfig(update);
|
||||
console.log("Received response:", updated);
|
||||
setConfig(updated);
|
||||
setSaveStatus("saved");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user