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