Skip to content

Commit

Permalink
Try to fix thumbnail upload
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed Nov 28, 2024
1 parent e7567b8 commit 233bdd1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/btrixcloud/colls.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,9 +608,13 @@ async def stream_iter():
f"Unable to delete previous collection thumbnail: {coll.thumbnail.filename}"
)

coll.thumbnail = thumbnail_file

# Update entire document to avoid bson.errors.InvalidDocument error
# with thumbnail
await self.collections.find_one_and_update(
{"_id": coll_id, "oid": org.id},
{"$set": {"thumbnail": dict(thumbnail_file)}},
{"$set": coll.to_dict()},
)

return {"added": True}
Expand Down

0 comments on commit 233bdd1

Please sign in to comment.