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 addition of snapshots in PatientFolder on Patient creation #89

Merged
merged 2 commits into from
Oct 3, 2023

Conversation

xispa
Copy link
Member

@xispa xispa commented Oct 3, 2023

Description of the issue/feature this PR addresses

This Pull Request removes the snapshots from PatientFolder and marks the object with IDoNotSupportSnapshots (and removes IAuditable marker as well).

Current behavior before PR

System adds an snapshot for each modification of Patient folder, the addition of patients included

/home/senaite/buildout-cache/eggs/ZODB-5.8.0-py2.7.egg/ZODB/Connection.py:578: 
UserWarning: The <class 'persistent.list.PersistentList'> object
you're saving is large. (21919517 bytes.)

Perhaps you're storing media which should be stored in blobs.                                                                                               
Perhaps you're using a non-scalable data structure, such as a
PersistentMapping or PersistentList.

Perhaps you're storing data in objects that aren't persistent at
all. In cases like that, the data is stored in the record of the
containing persistent object.

In any case, storing records this big is probably a bad idea.
If you insist and want to get rid of this warning, use the
large_record_size option of the ZODB.DB constructor (or the
large-record-size option in a configuration file) to specify a larger size.                                                                                                                                                       
  warnings.warn(large_object_message % (obj.__class__, len(p)))

where the PersistentList object is the list of snapshosts, one per Patient added

Desired behavior after PR is merged

System does not store snapshots for this folder

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

@xispa xispa changed the title Remove snapshots from PatientFolder Fix addition of snapshots in PatientFolder on Patient creation Oct 3, 2023
@xispa xispa requested a review from ramonski October 3, 2023 08:11
@xispa xispa added the bug Something isn't working label Oct 3, 2023
@ramonski ramonski merged commit 044bd9d into master Oct 3, 2023
@ramonski ramonski deleted the patientfolder-snapshots branch October 3, 2023 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

2 participants