Commit c81f2cb0 authored by Jérome Perrin's avatar Jérome Perrin

ERP5Form: fix argument name, createPreferenceForUser expect user_id

parent 9c7b83b6
......@@ -270,14 +270,14 @@ class PreferenceTool(BaseTool):
security.declareProtected(Permissions.ManagePortal,
'createPreferenceForUser')
def createPreferenceForUser(self, username, 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(username)
user = user_folder.getUserById(user_id)
if user is None:
raise ValueError("User %r not found" % (username, ))
raise ValueError("User %r not found" % (user_id, ))
security_manager = getSecurityManager()
try:
newSecurityManager(None, user.__of__(user_folder))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment