From ef14382e5fd7ee4262148fb7a68513b82eacfef9 Mon Sep 17 00:00:00 2001 From: liumangmang Date: Wed, 1 Jul 2026 17:58:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=90=8E=E7=AB=AF=E8=B7=AF=E7=94=B1=20g?= =?UTF-8?q?roup=5Fid=20=E5=90=AF=E7=94=A8=20path=20=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E8=BD=AC=E6=8D=A2=E5=99=A8=EF=BC=8C=E5=AE=8C?= =?UTF-8?q?=E7=BE=8E=E5=85=BC=E5=AE=B9=E5=B8=A6=E6=96=9C=E6=9D=A0=E7=9A=84?= =?UTF-8?q?=E8=BF=9C=E7=AB=AF=E5=88=86=E7=BB=84=20ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/routers/websites.py | 2 +- backend/test_website_group_mgmt.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/app/routers/websites.py b/backend/app/routers/websites.py index 241ec94..a2bd3fb 100644 --- a/backend/app/routers/websites.py +++ b/backend/app/routers/websites.py @@ -314,7 +314,7 @@ def create_website_group( raise HTTPException(502, str(exc)) -@router.put("/api/websites/{wid}/groups/{group_id}", response_model=dict) +@router.put("/api/websites/{wid}/groups/{group_id:path}", response_model=dict) def update_website_group( wid: int, group_id: str, diff --git a/backend/test_website_group_mgmt.py b/backend/test_website_group_mgmt.py index 7a8c489..5ec1fa0 100644 --- a/backend/test_website_group_mgmt.py +++ b/backend/test_website_group_mgmt.py @@ -42,7 +42,7 @@ def test_create_and_update_website_group(db_session, monkeypatch): b = WebsiteGroupBinding( website_id=w.id, - target_group_id="g123", + target_group_id="g/123", target_group_name="OldName", source_groups_json="[]", enabled=True @@ -81,12 +81,12 @@ def test_create_and_update_website_group(db_session, monkeypatch): # 2. Test update_website_group body_update = WebsiteGroupUpdate(name="UpdatedGroup", description="UpdatedDesc") - res_update = update_website_group(wid=w.id, group_id="g123", body=body_update, db=db_session) - assert res_update["id"] == "g123" + res_update = update_website_group(wid=w.id, group_id="g/123", body=body_update, db=db_session) + assert res_update["id"] == "g/123" assert res_update["name"] == "UpdatedGroup" assert res_update["description"] == "UpdatedDesc" assert len(called_update) == 1 - assert called_update[0][1] == "g123" + assert called_update[0][1] == "g/123" assert called_update[0][2] == {"name": "UpdatedGroup", "description": "UpdatedDesc"} # Verify that local binding was updated