Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix revision history #300

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ snovault
Change Log
----------

11.19.0
=======

* Fix for revision history - deepcopy history as to not modify props in place


11.18.0
=======

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dcicsnovault"
version = "11.18.0"
version = "11.19.0"
description = "Storage support for 4DN Data Portals."
authors = ["4DN-DCIC Team <[email protected]>"]
license = "MIT"
Expand Down
6 changes: 3 additions & 3 deletions snovault/crud_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
UUID,
uuid4,
)

from copy import deepcopy
import transaction
from pyramid.exceptions import HTTPForbidden
from pyramid.settings import asbool
Expand Down Expand Up @@ -379,7 +379,7 @@ def get_item_revision_history(request, uuid):
The more edits an item has undergone, the more expensive this
operation is.
"""
revisions = request.registry[STORAGE].revision_history(uuid=uuid)
revisions = deepcopy(request.registry[STORAGE].revision_history(uuid=uuid))
# Resolve last_modified
# NOTE: last_modified is a server_default present in our applications that
# use snovault. This code is intended to resolve the user email of the last_modified
Expand All @@ -393,7 +393,7 @@ def get_item_revision_history(request, uuid):
if not user:
user = request.embed(modified_by, frame='raw')
user_cache[modified_by] = user
revision['last_modified']['modified_by'] = user.get('email', 'No email specified!')
revision['last_modified']['modified_by'] = user['email']
return revisions


Expand Down
Loading