def put(self, user_id, data=None):
        """
        .. http:put:: /users/1

           Update a user

           **Example request with ID**:

           .. sourcecode:: http

              PUT /users/1 HTTP/1.1
              Host: example.com
              Accept: application/json, text/javascript
              Content-Type: application/json;charset=UTF-8

              {
                 "username": "user1",
                 "email": "user1@example.com",
                 "active": false,
                 "roles": [
                     {"id": 1}
                 ]
              }

           **Example request with name**:

           .. sourcecode:: http

              PUT /users/1 HTTP/1.1
              Host: example.com
              Accept: application/json, text/javascript
              Content-Type: application/json;charset=UTF-8

              {
                 "username": "user1",
                 "email": "user1@example.com",
                 "active": false,
                 "roles": [
                     {"name": "myRole"}
                 ]
              }

           **Example response**:

           .. sourcecode:: http

              HTTP/1.1 200 OK
              Vary: Accept
              Content-Type: text/javascript

              {
                 "id": 1,
                 "username": "user1",
                 "email": "user1@example.com",
                 "active": false,
                 "profileImage": null
              }

           :reqheader Authorization: OAuth token to authenticate
           :statuscode 200: no error
        """
        return service.update(
            user_id,
            data["username"],
            data["email"],
            data["active"],
            None,
            data["roles"],
            data.get("password")
        )

        .. http:put:: /users/1

           Update a user

           **Example request with ID**:

           .. sourcecode:: http

              PUT /users/1 HTTP/1.1
              Host: example.com
              Accept: application/json, text/javascript
              Content-Type: application/json;charset=UTF-8

              {
                 "username": "user1",
                 "email": "user1@example.com",
                 "active": false,
                 "roles": [
                     {"id": 1}
                 ]
              }

           **Example request with name**:

           .. sourcecode:: http

              PUT /users/1 HTTP/1.1
              Host: example.com
              Accept: application/json, text/javascript
              Content-Type: application/json;charset=UTF-8

              {
                 "username": "user1",
                 "email": "user1@example.com",
                 "active": false,
                 "roles": [
                     {"name": "myRole"}
                 ]
              }

           **Example response**:

           .. sourcecode:: http

              HTTP/1.1 200 OK
              Vary: Accept
              Content-Type: text/javascript

              {
                 "id": 1,
                 "username": "user1",
                 "email": "user1@example.com",
                 "active": false,
                 "profileImage": null
              }

           :reqheader Authorization: OAuth token to authenticate
           :statuscode 200: no error
        
lemur/users/views.py