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

Add missing weakref.proxy #2821

Merged
merged 1 commit into from
Aug 16, 2024
Merged

Add missing weakref.proxy #2821

merged 1 commit into from
Aug 16, 2024

Conversation

neolooong
Copy link
Contributor

@neolooong neolooong commented Jun 20, 2024

Fix #2820.

@neolooong neolooong closed this Jun 20, 2024
@@ -188,7 +191,10 @@ def _mark_as_changed(self, key=None):
class EmbeddedDocumentList(BaseList):
def __init__(self, list_items, instance, name):
super().__init__(list_items, instance, name)
self._instance = instance
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where the problem was, although self._instance was correctly converted to a weakref.proxy in super().__init__, it was being overwritten here.

This code is actually unnecessary since it's already handled in the parent class __init__. I'll push an updated version of this code (getting rid of EmbeddedDocumentList.init as it's not needed)

@bagerard bagerard merged commit 8c364e9 into MongoEngine:master Aug 16, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EmbeddedDocumentListField causes additional memory usage.
2 participants