Skip to content

Commit

Permalink
fix: allow Undefined value to ModifyGroupInput.user_update_mode (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
fregataa authored Nov 7, 2023
1 parent c6479b8 commit b31efcb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions changes/1698.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow `Undefined` value of `ModifyGroupInput.user_update_mode` field to enable client-py updates group.
3 changes: 2 additions & 1 deletion src/ai/backend/manager/models/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import graphene
import sqlalchemy as sa
from graphene.types.datetime import DateTime as GQLDateTime
from graphql import Undefined
from sqlalchemy.engine.row import Row
from sqlalchemy.ext.asyncio import AsyncConnection as SAConnection
from sqlalchemy.orm import relationship
Expand Down Expand Up @@ -486,7 +487,7 @@ async def mutate(

if "name" in data and _rx_slug.search(data["name"]) is None:
raise ValueError("invalid name format. slug format required.")
if props.user_update_mode not in (None, "add", "remove"):
if props.user_update_mode not in (None, Undefined, "add", "remove"):
raise ValueError("invalid user_update_mode")
if not props.user_uuids:
props.user_update_mode = None
Expand Down

0 comments on commit b31efcb

Please sign in to comment.