diff --git a/backend/btrixcloud/colls.py b/backend/btrixcloud/colls.py index 7e398ceaa..22ad1e8d3 100644 --- a/backend/btrixcloud/colls.py +++ b/backend/btrixcloud/colls.py @@ -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}