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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Noah Brackenbury
erp5
Commits
39bfe1dc
Commit
39bfe1dc
authored
Oct 24, 2016
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_base: user getUserValue() and getLoginValueList() in ERP5UserFactory.
parent
32aa838d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getAuthenticatedMemberPersonValue.py
...s/erp5_base/ERP5Site_getAuthenticatedMemberPersonValue.py
+7
-6
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/PreferenceTool_setNewPassword.py
...m/portal_skins/erp5_base/PreferenceTool_setNewPassword.py
+1
-2
No files found.
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getAuthenticatedMemberPersonValue.py
View file @
39bfe1dc
...
...
@@ -3,9 +3,10 @@ Returns None if no corresponding person, for example when not using ERP5Security
"""
portal
=
context
.
getPortalObject
()
if
user_name
is
None
:
user_name
=
portal
.
portal_membership
.
getAuthenticatedMember
()
from
Products.ERP5Security.ERP5UserManager
import
getUserByLogin
found_user_list
=
getUserByLogin
(
portal
,
str
(
user_name
))
if
len
(
found_user_list
)
==
1
:
return
found_user_list
[
0
]
return
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
().
getUserValue
()
user_list
=
[
x
for
x
in
portal
.
acl_users
.
searchUsers
(
exact_match
=
True
,
id
=
user_name
,
)
if
'path'
in
x
]
if
len
(
user_list
)
==
1
:
return
portal
.
restrictedTraverse
(
user_list
[
0
][
'path'
])
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/PreferenceTool_setNewPassword.py
View file @
39bfe1dc
...
...
@@ -3,8 +3,7 @@ from Products.ERP5Type.Message import translateString
portal
=
context
.
getPortalObject
()
user
=
getSecurityManager
().
getUser
()
person
=
portal
.
restrictedTraverse
(
portal
.
acl_users
.
erp5_users
.
enumerateUsers
(
id
=
user
.
getId
())[
0
][
'path'
])
for
login
in
person
.
objectValues
(
portal_type
=
'ERP5 Login'
):
for
login
in
user
.
getLoginValueList
(
portal_type
=
'ERP5 Login'
):
if
login
.
getReference
()
==
reference
and
login
.
getValidationState
()
==
'validated'
:
break
else
:
...
...
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