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): ...@@ -270,14 +270,14 @@ class PreferenceTool(BaseTool):
security.declareProtected(Permissions.ManagePortal, security.declareProtected(Permissions.ManagePortal,
'createPreferenceForUser') '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 """Creates a preference for a given user, and optionnally enable the
preference. preference.
""" """
user_folder = self.acl_users user_folder = self.acl_users
user = user_folder.getUserById(username) user = user_folder.getUserById(user_id)
if user is None: if user is None:
raise ValueError("User %r not found" % (username, )) raise ValueError("User %r not found" % (user_id, ))
security_manager = getSecurityManager() security_manager = getSecurityManager()
try: try:
newSecurityManager(None, user.__of__(user_folder)) 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