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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alecs_myu
erp5
Commits
c81f2cb0
Commit
c81f2cb0
authored
May 15, 2017
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Form: fix argument name, createPreferenceForUser expect user_id
parent
9c7b83b6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
product/ERP5Form/PreferenceTool.py
product/ERP5Form/PreferenceTool.py
+3
-3
No files found.
product/ERP5Form/PreferenceTool.py
View file @
c81f2cb0
...
...
@@ -270,14 +270,14 @@ class PreferenceTool(BaseTool):
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'createPreferenceForUser'
)
def
createPreferenceForUser
(
self
,
user
name
,
enable
=
True
):
def
createPreferenceForUser
(
self
,
user
_id
,
enable
=
True
):
"""Creates a preference for a given user, and optionnally enable the
preference.
"""
user_folder
=
self
.
acl_users
user
=
user_folder
.
getUserById
(
user
name
)
user
=
user_folder
.
getUserById
(
user
_id
)
if
user
is
None
:
raise
ValueError
(
"User %r not found"
%
(
user
name
,
))
raise
ValueError
(
"User %r not found"
%
(
user
_id
,
))
security_manager
=
getSecurityManager
()
try
:
newSecurityManager
(
None
,
user
.
__of__
(
user_folder
))
...
...
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