From 217e3a13c8aee731ec88ec2545d479650fb23ca7 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Fri, 17 Jan 2025 12:03:24 -0800 Subject: [PATCH] feat: Add ability to change permissions on group creation API --- backend/open_webui/models/groups.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/models/groups.py b/backend/open_webui/models/groups.py index 94f4cfae8..5885226ce 100644 --- a/backend/open_webui/models/groups.py +++ b/backend/open_webui/models/groups.py @@ -80,10 +80,10 @@ class GroupResponse(BaseModel): class GroupForm(BaseModel): name: str description: str + permissions: Optional[dict] = None class GroupUpdateForm(GroupForm): - permissions: Optional[dict] = None user_ids: Optional[list[str]] = None admin_ids: Optional[list[str]] = None @@ -95,7 +95,7 @@ class GroupTable: with get_db() as db: group = GroupModel( **{ - **form_data.model_dump(), + **form_data.model_dump(exclude_none=True), "id": str(uuid.uuid4()), "user_id": user_id, "created_at": int(time.time()),