mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-10 22:43:29 +00:00
Merge pull request #24486 from Classic298/fix/notes-is-pinned-typeerror
fix: notes is_pinned TypeError on create/get
This commit is contained in:
parent
0f07af1bb8
commit
a0268e51fc
2 changed files with 5 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
)
|
||||
|
||||
|
||||
############################
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue