From 2299bd51bad70a31e9dccbb128c2253113be144f Mon Sep 17 00:00:00 2001 From: Alex Blank Date: Sun, 24 May 2026 18:29:03 +0000 Subject: [PATCH] fix: handle already-serialized mount dicts in profile update When FastAPI parses the request body and model_dump() is called, nested MountItem models are already serialized to plain dicts. The update handler was unconditionally calling model_dump() again, causing AttributeError on dict objects. Fix: Check if mount items are already dicts before calling model_dump(). Fixes: 422 error when updating profiles with mounts. --- apps/api/src/api/config_profiles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/api/config_profiles.py b/apps/api/src/api/config_profiles.py index 97d8907..08eef3b 100644 --- a/apps/api/src/api/config_profiles.py +++ b/apps/api/src/api/config_profiles.py @@ -429,7 +429,7 @@ async def update_config_profile( if field_name in ("project_id", "tool_type_id"): value = uuid.UUID(value) if value else None elif field_name == "mounts" and value is not None: - value = [m.model_dump() for m in value] + value = [m.model_dump() if not isinstance(m, dict) else m for m in value] setattr(profile, field_name, value) await session.commit()