

def put(self, *args):
    if ((not self.api_key.can_create_user()) and (self.key_username != args[0])):
        raise HTTPError(403)
    try:
        (password, user_type, key, extra) = self.fetch_user(update=True)
    except ValueError:
        raise HTTPError(400)
    try:
        self.auth_mgr.update_user(args[0], password, user_type=user_type, key=key, extra=extra)
    except UserConflict:
        raise HTTPError(409)
    self.write({
        'ok': True,
    })

dataset/ETHPy150Open benoitc/gaffer/gaffer/gafferd/http_handlers/user.py UserHandler.put/original