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
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Lu Xu
erp5
Commits
9405ec7d
Commit
9405ec7d
authored
Jul 03, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some typos
parent
e5be3a3a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.SessionTool.py
...ntTemplateItem/portal_components/tool.erp5.SessionTool.py
+7
-7
product/ERP5Type/patches/CMFCoreSkinnable.py
product/ERP5Type/patches/CMFCoreSkinnable.py
+1
-1
product/ERP5Type/tests/ERP5TypeLiveTestCase.py
product/ERP5Type/tests/ERP5TypeLiveTestCase.py
+2
-2
product/ERP5Type/tests/ERP5TypeTestCase.py
product/ERP5Type/tests/ERP5TypeTestCase.py
+1
-1
No files found.
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.SessionTool.py
View file @
9405ec7d
...
@@ -92,11 +92,11 @@ class Session(UserDict):
...
@@ -92,11 +92,11 @@ class Session(UserDict):
# used to set duration of session
# used to set duration of session
session_duration
=
None
session_duration
=
None
# a handle to current aquisition context
# a handle to current a
c
quisition context
_aq_context
=
None
_aq_context
=
None
def
__getstate__
(
self
):
def
__getstate__
(
self
):
"""filter out acqusition wrappers when serializing.
"""filter out acqu
i
sition wrappers when serializing.
"""
"""
state
=
{
state
=
{
'session_duration'
:
self
.
session_duration
,
'session_duration'
:
self
.
session_duration
,
...
@@ -107,12 +107,12 @@ class Session(UserDict):
...
@@ -107,12 +107,12 @@ class Session(UserDict):
return
state
return
state
def
_updatecontext
(
self
,
aq_context
):
def
_updatecontext
(
self
,
aq_context
):
""" Update current aquisition context. """
""" Update current a
c
quisition context. """
self
.
_aq_context
=
aq_context
self
.
_aq_context
=
aq_context
def
__getitem__
(
self
,
key
):
def
__getitem__
(
self
,
key
):
if
key
in
self
.
data
:
if
key
in
self
.
data
:
# returned it wrapped in aquisition context
# returned it wrapped in a
c
quisition context
return
restore_acquisition_wrapper
(
self
.
data
[
key
],
self
.
_aq_context
)
return
restore_acquisition_wrapper
(
self
.
data
[
key
],
self
.
_aq_context
)
raise
KeyError
(
key
)
raise
KeyError
(
key
)
...
@@ -213,10 +213,10 @@ class SessionTool(BaseTool):
...
@@ -213,10 +213,10 @@ class SessionTool(BaseTool):
shopping_cart = session['shopping_cart']
shopping_cart = session['shopping_cart']
Please note that:
Please note that:
- developer is responsible for handling an unique session
d
_id (using cookies for example).
- developer is responsible for handling an unique session_id (using cookies for example).
- it's not recommended to store in portal_sessions ZODB persistent objects because in order
- it's not recommended to store in portal_sessions ZODB persistent objects because in order
to store them in Local RAM portal_sessions tool will remove aquisition wrapper. At "get"
to store them in Local RAM portal_sessions tool will remove a
c
quisition wrapper. At "get"
request they'll be retur
en
d wrapped.
request they'll be retur
ne
d wrapped.
- developer can store temporary ERP5 documents like 'TempOrder', but keep
- developer can store temporary ERP5 documents like 'TempOrder', but keep
in mind that after making changes to temporary documents they need to be
in mind that after making changes to temporary documents they need to be
saved again in portal_sessions, so:
saved again in portal_sessions, so:
...
...
product/ERP5Type/patches/CMFCoreSkinnable.py
View file @
9405ec7d
...
@@ -201,7 +201,7 @@ class SkinDataCleanup:
...
@@ -201,7 +201,7 @@ class SkinDataCleanup:
if
skindata
is
not
None
:
if
skindata
is
not
None
:
if
self
.
hashSkinData
(
skindata
)
==
self
.
skindata_id
:
if
self
.
hashSkinData
(
skindata
)
==
self
.
skindata_id
:
try
:
try
:
# Entry might have already disapeared. Ignore.
# Entry might have already disap
p
eared. Ignore.
del
SKINDATA
[
tid
]
del
SKINDATA
[
tid
]
except
KeyError
:
except
KeyError
:
pass
pass
...
...
product/ERP5Type/tests/ERP5TypeLiveTestCase.py
View file @
9405ec7d
...
@@ -78,14 +78,14 @@ class ERP5TypeLiveTestCase(ERP5TypeTestCaseMixin):
...
@@ -78,14 +78,14 @@ class ERP5TypeLiveTestCase(ERP5TypeTestCaseMixin):
def
getPortal
(
self
):
def
getPortal
(
self
):
"""Returns the portal object, i.e. the "fixture root".
"""Returns the portal object, i.e. the "fixture root".
Rewrap the portal in an independ
a
nt request for this test.
Rewrap the portal in an independ
e
nt request for this test.
"""
"""
if
self
.
portal
is
not
None
:
if
self
.
portal
is
not
None
:
return
self
.
portal
return
self
.
portal
from
Products.ERP5.ERP5Site
import
getSite
from
Products.ERP5.ERP5Site
import
getSite
site
=
getSite
()
site
=
getSite
()
# reconstruct the acquis
tion chain with an independa
nt request.
# reconstruct the acquis
ition chain with an independe
nt request.
# RequestContainer -> Application -> Site
# RequestContainer -> Application -> Site
from
Testing.ZopeTestCase.utils
import
makerequest
from
Testing.ZopeTestCase.utils
import
makerequest
portal
=
getattr
(
makerequest
(
site
.
aq_parent
),
site
.
getId
())
portal
=
getattr
(
makerequest
(
site
.
aq_parent
),
site
.
getId
())
...
...
product/ERP5Type/tests/ERP5TypeTestCase.py
View file @
9405ec7d
...
@@ -544,7 +544,7 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase):
...
@@ -544,7 +544,7 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase):
User password is the reference.
User password is the reference.
"""
"""
user
=
self
.
createUser
(
reference
,
person_kw
=
dict
(
title
=
title
))
user
=
self
.
createUser
(
reference
,
person_kw
=
dict
(
title
=
title
))
assignment
=
self
.
createUserAssign
e
ment
(
user
,
assignment_kw
=
dict
(
function
=
function
))
assignment
=
self
.
createUserAssignment
(
user
,
assignment_kw
=
dict
(
function
=
function
))
return
user
return
user
def
createUser
(
self
,
reference
,
password
=
None
,
person_kw
=
None
):
def
createUser
(
self
,
reference
,
password
=
None
,
person_kw
=
None
):
...
...
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