Skip to content

Commit 1f10495

Browse files
committed
Migration fix
1 parent b761342 commit 1f10495

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/zxbasic/app/routes/compile.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929

3030
class SessionVars(BaseModel):
3131
x_hasura_role: str = Field(alias="x-hasura-role")
32-
x_hasura_user_id: Optional[UUID] = Field(alias="x-hasura-user-id")
32+
# Absent for the public/unauthenticated role (e.g. the bot rendering a public
33+
# project). In pydantic v2 Optional[...] without a default is still required,
34+
# so default to None to make the field genuinely optional.
35+
x_hasura_user_id: Optional[UUID] = Field(default=None, alias="x-hasura-user-id")
3336

3437

3538
class Input(BaseModel):

0 commit comments

Comments
 (0)