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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user