def updateUser(username, password, fullname, email, role):
"""Updates a L{User}.
@param username: A C{unicode} username for the user.
@param password: A C{unicode} password in plain text for the user. The
password will be hashed before being stored.
@param fullname: A C{unicode} name for the user.
@param email: The C{unicode} email address for the user.
@param role: The L{Role} for the user.
@return: @return: A C{(objectID, username)} 2-tuple representing the
L{User} that was updated.
"""
try:
result = UserAPI().set([(username, password, fullname, email, role)])
transaction.commit()
except:
transaction.abort()
raise
return result
评论列表
文章目录