This bug has been hard to replicate.
When a block is made then a manual save triggered the block data can show up in the diff:
Steps to reproduce:
- Make a new sample
- Change something trivial and save by clicking the floppy disk
- Add a block (preferably CycleBlock)
- Attach a file
- Click Save Item again
- View Version History
The fix is in items.py on line 1798 for save_item to change:
item = ITEM_MODELS[item_type](**item).dict()
to
item = ITEM_MODELS[item_type](**item).dict(exclude_none=True)
But worth checking follow on effects of this change:
"Fixed" behaviour:
I believe this behaviour is already fixed in pydantic v2 due to exclude_unset=True being used there
This bug has been hard to replicate.
When a block is made then a manual save triggered the block data can show up in the diff:
Steps to reproduce:
The fix is in items.py on line 1798 for
save_itemto change:item = ITEM_MODELS[item_type](**item).dict()to
item = ITEM_MODELS[item_type](**item).dict(exclude_none=True)But worth checking follow on effects of this change:
"Fixed" behaviour:
I believe this behaviour is already fixed in pydantic v2 due to exclude_unset=True being used there