# HG changeset patch # User Marcin Kuzminski # Date 2012-06-25 21:20:27 # Node ID 374693af2849964b6eeb92b3709139b32c54390c # Parent 7e3e9d0c55758df5f1edfc1f0d1dfd082d9d8aa8 API: update_user returns new updated user data diff --git a/docs/api/api.rst b/docs/api/api.rst --- a/docs/api/api.rst +++ b/docs/api/api.rst @@ -273,7 +273,18 @@ OUTPUT:: result: { "id" : "", - "msg" : "updated user ID: " + "msg" : "updated user ID: ", + "user": { + "id" : "", + "username" : "", + "firstname": "", + "lastname" : "", + "email" : "", + "active" : "", + "admin" :  "", + "ldap_dn" : "", + "last_login": "", + }, } error: null diff --git a/rhodecode/controllers/api/api.py b/rhodecode/controllers/api/api.py --- a/rhodecode/controllers/api/api.py +++ b/rhodecode/controllers/api/api.py @@ -202,14 +202,25 @@ class ApiController(JSONRPCController): raise JSONRPCError("user ID:%s does not exist" % userid) try: - usr = UserModel().create_or_update( + user = UserModel().create_or_update( username, password, email, firstname, lastname, active, admin, ldap_dn ) Session.commit() return dict( id=usr.user_id, - msg='updated user ID:%s %s' % (usr.user_id, usr.username) + msg='updated user ID:%s %s' % (user.user_id, user.username), + user=dict( + id=user.user_id, + username=user.username, + firstname=user.name, + lastname=user.lastname, + email=user.email, + active=user.active, + admin=user.admin, + ldap_dn=user.ldap_dn, + last_login=user.last_login, + ) ) except Exception: log.error(traceback.format_exc())