From a0268e51fc12c33b6df447bead4909ecd6733ebc Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Sat, 9 May 2026 13:56:06 +0200 Subject: [PATCH] Merge pull request #24486 from Classic298/fix/notes-is-pinned-typeerror fix: notes is_pinned TypeError on create/get --- backend/open_webui/models/notes.py | 2 +- backend/open_webui/routers/notes.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/models/notes.py b/backend/open_webui/models/notes.py index a665004a95..f651d226ca 100644 --- a/backend/open_webui/models/notes.py +++ b/backend/open_webui/models/notes.py @@ -140,7 +140,7 @@ class NoteTable: } ) - new_note = Note(**note.model_dump(exclude={'access_grants'})) + new_note = Note(**note.model_dump(exclude={'access_grants', 'is_pinned'})) db.add(new_note) await db.commit() diff --git a/backend/open_webui/routers/notes.py b/backend/open_webui/routers/notes.py index 9a23a104c9..5ed46b5d61 100644 --- a/backend/open_webui/routers/notes.py +++ b/backend/open_webui/routers/notes.py @@ -294,7 +294,10 @@ async def get_note_by_id( ) pinned_note_ids = await Notes.get_pinned_note_ids(user.id, db=db) - return NoteResponse(**note.model_dump(), write_access=write_access, is_pinned=note.id in pinned_note_ids) + return NoteResponse( + **{**note.model_dump(), 'is_pinned': note.id in pinned_note_ids}, + write_access=write_access, + ) ############################