Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastien Robin
erp5
Commits
f5a6c842
Commit
f5a6c842
authored
Jun 29, 2011
by
Yusei Tahara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a comment about dangerous side effect of asContext method.
parent
253df711
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+8
-0
No files found.
product/ERP5Type/Base.py
View file @
f5a6c842
...
...
@@ -2578,7 +2578,15 @@ class Base( CopyContainer,
temp_object
=
True
,
is_indexable
=
False
)
# Attention! Here all contents of self.__dict__ are
# passed to context. This means that if self contains
# persistent object, it may be modified through the context.
# And if context is cached on memory, ConnectionStateError
# may occur. Thus this is very dangerous code.
# If asContext is expected to return a copied temporary object,
# copy.deepcopy must be used here.
context
.
__dict__
.
update
(
self
.
__dict__
)
# Copy REQUEST properties to self
if
REQUEST
is
not
None
:
# Avoid copying a SESSION object, because it is newly created
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment