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
Tristan Cavelier
erp5
Commits
c6d2392e
Commit
c6d2392e
authored
Jun 12, 2013
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use OOBTree instead of PersistentMapping for PasswordTool's dict.
to avoid conflicts and to improve disk space efficiency.
parent
6b83d2b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
product/ERP5/Tool/PasswordTool.py
product/ERP5/Tool/PasswordTool.py
+6
-9
No files found.
product/ERP5/Tool/PasswordTool.py
View file @
c6d2392e
...
...
@@ -40,6 +40,7 @@ from hashlib import md5
from
DateTime
import
DateTime
from
Products.ERP5Type.Message
import
translateString
from
Products.ERP5Type.Globals
import
PersistentMapping
from
BTrees.OOBTree
import
OOBTree
from
urllib
import
urlencode
class
PasswordTool
(
BaseTool
):
...
...
@@ -60,12 +61,11 @@ class PasswordTool(BaseTool):
_expiration_day
=
1
_password_request_dict
=
{}
def
__init__
(
self
,
id
=
None
):
if
id
is
None
:
id
=
self
.
__class__
.
id
self
.
_password_request_dict
=
PersistentMapping
()
self
.
_password_request_dict
=
OOBTree
()
# XXX no call to BaseTool.__init__ ?
# BaseTool.__init__(self, id)
...
...
@@ -77,13 +77,10 @@ class PasswordTool(BaseTool):
# generate a random string
key
=
self
.
_generateUUID
()
# XXX before r26093, _password_request_dict was initialized by an OOBTree and
# replaced by a dict on each request, so if it's data structure is not up
# to date, we update it if needed
if
not
isinstance
(
self
.
_password_request_dict
,
PersistentMapping
):
LOG
(
'ERP5.PasswordTool'
,
INFO
,
'Updating password_request_dict to'
' PersistentMapping'
)
self
.
_password_request_dict
=
PersistentMapping
()
if
isinstance
(
self
.
_password_request_dict
,
PersistentMapping
):
LOG
(
'ERP5.PasswordTool'
,
INFO
,
'Migrating password_request_dict to'
' OOBTree'
)
self
.
_password_request_dict
=
OOBTree
(
self
.
_password_request_dict
)
# register request
self
.
_password_request_dict
[
key
]
=
(
user_login
,
expiration_date
)
...
...
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