fix: clean migration, cross-team isolation test, and PUT field-set fix for target_lists

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-02-17 11:29:25 -05:00
parent 0c2d4ba685
commit adcdf39d35
5 changed files with 91 additions and 393 deletions

View File

@@ -85,11 +85,12 @@ async def update_target_list(
target_list = result.scalar_one_or_none()
if not target_list:
raise HTTPException(status_code=404, detail="Target list not found")
if data.name is not None:
update_fields = data.model_fields_set
if "name" in update_fields and data.name is not None:
target_list.name = data.name
if data.description is not None:
target_list.description = data.description
if data.targets is not None:
if "description" in update_fields:
target_list.description = data.description # allow setting to None
if "targets" in update_fields and data.targets is not None:
target_list.targets = [t.model_dump() for t in data.targets]
await db.commit()
await db.refresh(target_list)